Dear experts,
Am creating sales invoice automatically by using code. In order to create the new sales order by using code i need get and assign the latest sales order no before insert the data to sales header. Anybody know what's the code for it? Thanks in adv.
0
Comments
For sales orders it is table 36 Sales header with the code
CASE "Document Type" OF
"Document Type"::Quote,"Document Type"::Order:
BEGIN
NoSeriesMgt.SetDefaultSeries("Posting No. Series",SalesSetup."Posted Invoice Nos.");
NoSeriesMgt.SetDefaultSeries("Shipping No. Series",SalesSetup."Posted Shipment Nos.");
IF "Document Type" = "Document Type"::Order THEN BEGIN
NoSeriesMgt.SetDefaultSeries("Prepayment No. Series",SalesSetup."Posted Prepmt. Inv. Nos.");
NoSeriesMgt.SetDefaultSeries("Prepmt. Cr. Memo No. Series",SalesSetup."Posted Prepmt. Cr. Memo Nos.");
END;
END;