AX 2012 Post Partial Sales Order using x++ code
static void Job50(Args _args)
{
salesLine salesLine;
salesFormLetter salesFormLetter;
SalesTable salestable;
;
ttsbegin;
//update Sales Line
salestable = salestable::find('SO_0002');
salesLine = SalesLine::find('SO_0002', 1, true); // find your itemid.
salesLine.SalesDeliverNow = 1;
salesLine.setInventDeliverNow();
salesLine.doUpdate();
//Post the delivery note
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(salesTable, SystemDateGet(),SalesUpdate::DeliverNow, AccountOrder::None, false, false);
ttsCommit;
}
static void Job50(Args _args)
{
salesLine salesLine;
salesFormLetter salesFormLetter;
SalesTable salestable;
;
ttsbegin;
//update Sales Line
salestable = salestable::find('SO_0002');
salesLine = SalesLine::find('SO_0002', 1, true); // find your itemid.
salesLine.SalesDeliverNow = 1;
salesLine.setInventDeliverNow();
salesLine.doUpdate();
//Post the delivery note
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(salesTable, SystemDateGet(),SalesUpdate::DeliverNow, AccountOrder::None, false, false);
ttsCommit;
}
No comments:
Post a Comment