It sometimes happens that a user manually creates a sales order for an EDI customer and forgets to set the
Later they notice that they cannot send any DESADV or INVOICE and ask support.
We assume that
C_Invoicehave the same
Assume the order’s
POReference is ‘123456’
How to fix this:
UPDATE C_Order SET IsEDIEnAbled='Y', Updated=now(), Updatedby=99 WHERE POReference='123456'; UPDATE M_InOut SET IsEDIEnAbled='Y', Updated=now(), Updatedby=99 WHERE POReference='123456'; UPDATE C_Invoice SET IsEDIEnAbled='Y', EDI_ExportStatus='P', Updated=now(), Updatedby=99 WHERE POReference='123456';
At this point, the invoice can already be sent as EDI-INVOICE.
For the DESADV, we need to create the EDI_Desadv record. To do that, we can now use a dedicated process (
AD_Process.Value='EDI_Desadv_Create_From_C_Order') from the sales order’s gear.
That process is available if the current sales order is completed or closed, has
IsEdiEnabled=Y and does not yet reference an
EDI_Desadvrecords, if another order needs to be added. In this case, the DESADV record is updated.
M_InOutsto the currently processed order’s
EDI_Desadvrecord if they reference that order, have the same
POReference, are completed or closed, have
IsEdiEnabled=Yand do not reference an