Dynamics AX Blog - Posts from 30 November 2014
These posts are machine-translated.
Post sales order confirmation through codeWith the help of the following lines, I want to show how you can post a sales order confirmation by code.
static void postSalesConfirmation(Args _args)
{
SalesTable salesTable = SalesTable::find("000747");
SalesFormLetter salesFormLetter;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::All);
} |
Post sales packing slip through codeWith the help of the following lines, I want to show how you can post a sales packing slip by code.
static void postSalesPackingslip(Args _args)
{
SalesTable salesTable = SalesTable::find("000747");
SalesFormLetter salesFormLetter;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::All);
} |
Post sales invoice through codeWith the help of the following lines, I want to show how you can post a sales invoice by code.
static void postSalesInvoice(Args _args)
{
SalesTable salesTable = SalesTable::find("000747");
SalesFormLetter salesFormLetter;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::All);
} |
|
|
|
|
|
|

With the help of the following lines, I want to show how you can post a purchase order by code.
Those, who want to have more control over the data to be posted, should take a look at the parameters of purchFormLetter.update().
static void postPurchaseOrder(Args _args) { PurchTable purchTable = PurchTable::find("000025"); PurchFormLetter purchFormLetter; purchFormLetter = PurchFormLetter::construct(DocumentStatus::PurchaseOrder); purchFormLetter.update(purchTable, "", systemDateGet(), PurchUpdate::All); }