AX 2012: Posting Packing Slip using X++

static void JobPostPackingSlip(Args _args)
{
SalesFormLetter_PackingSlip     salesFormLetter_PackingSlip;

SalesTable                      salesTable;
CustPackingSlipJour             custPackingSlipJour;

;

ttsBegin;
salesTable = SalesTable::find(‘SO00000001’);
salesFormLetter_PackingSlip = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter_PackingSlip.showQueryForm(false);
salesFormLetter_PackingSlip.update(salesTable,
systemDateGet(),
SalesUpdate::DeliverNow,
AccountOrder::None,
false,
false);
ttsCommit;

if (CustPackingSlipJour::exist(‘SO00000001’))
info(strFmt(‘Sales Order successfully delivered!’));
else
info(strFmt(‘Sales Order failed to deliver!’));
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s