Tuesday, September 12, 2023

Invoice a sales order using X++

 


Code :

SalesFormLetter salesFormLetter;

       SalesTable        salesTable;

       salesTable=SalesTable::find("000810");

       salesFormLetter=SalesFormLetter::construct(DocumentStatus::Invoice);

       salesFormLetter.update(salesTable);

       info(strFmt("%1 Sales Order Posted and Final Status is Invoiced",salesTable.SalesId));


IF you are getting "Posting An error occurred during update" error then :

Inventory Management > Setup > Inventory > Item Model Groups > FIFO 

Select the checkbox Physical negative inventory.













No comments:

Post a Comment