Showing posts with label How to Invoice Purchase order through code in Ax 2012. Show all posts
Showing posts with label How to Invoice Purchase order through code in Ax 2012. Show all posts

Wednesday, 3 February 2016

How to Invoice Purchase order through code in Ax 2012

static void Raj_POInvoice(Args _args)
{
    PurchFormLetter     purchFormLetter;
    PurchTable          purchTable;

    purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice);
    purchTable = purchTable::find("Yours Purch id");
    purchFormLetter.update(purchTable, 'Yours Purch id',today());
    info(strFmt("purchase order %1 invoiced",purchTable.PurchId));

}