AX 2012 | D365: Post Packing Slip using X++
static void postPackingSlip(Args _args) { SalesFormLetter salesFormLetter; SalesTable salesTable; SalesId salesId = ‘SO00001’; System.Exception error; str strError; CustPackingSlipJour custPackingSlipJour; ; ttsBegin; try { salesTable = SalesTable::find(salesId); if (salesTable && salesTable.SalesStatus == SalesStatus::Backorder) { salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip); salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::PackingSlip, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No); if (salesFormLetter.parmJournalRecord().TableId == tableNum(custPackingSlipJour)) { custPackingSlipJour = salesFormLetter.parmJournalRecord(); info(strFmt(‘New Packing Slip #:%1…