Share via


Dynamics AX 2012 R2 X++: Update picking list for sales order

We can generate the picking list for sales order with X++ Code.

Following X++ code example will help you to update picking list for specific Sales Order:

public static  void UpdateSalesOrder_PickingList(Args _args)
{
  SalesFormLetter_PickingList  salesFormLetterPickingList;
  SalesTable   salesTable = salesTable::find('SAO-12345');   
  salesFormLetterPickingList = SalesFormLetter_PickingList::newPickingList();
  salesFormLetterPickingList.transDate(systemDateGet());
  salesFormLetterPickingList.update(salesTable,
  systemdateget(),
  SalesUpdate::All,
  AccountOrder::None,
  NoYes::No,
  NoYes::No);}

Note: For more control over data to be posted, you should take a look at the parameters of salesFormLetterPickingList.update(), Specifically parameter SalesUpdate enum.