Tuesday, April 24, 2018

How to Post Sales Order Invoice through X++ in Dynamics 365 FO


A very common requirement these days is to automate the Invoice Posting for Sales Orders.


Follow the below mentioned steps :-


Step 1) Add a new Runnable class in your Project














Step 2) Write the following code :-


 SalesFormLetter         letter      = SalesFormLetter::construct(DocumentStatus::Invoice);
 SalesTable                   salestbl;

salestbl=SalesTable::find('000814');
 
 
letter.update(salestbl,SystemDateGet(),SalesUpdate::All,AccountOrder::None,false,true);

 info('Success');


No comments:

Post a Comment

How to reverse Free Text Invoice Voucher entries without Dialog

 Hey Folks ,  This blog post is in continuation of the previous post for Reversing Free Text Invoice Voucher entries with Dialog. Only diffe...