Skip to main content

Posts

Showing posts with the label purchformletter

Create and post Purchase order in Axapta 2012

If you want to Create and post Purchase order in Axapta 2012 then you can try following code. In purchase order posting purchase invoice no. is compulsory so you need to mention invoice id  in code also. 1. Create purchase order PurchTable purchTable; PurchLine purchLine; VendTable vendTable = VendTable::find("v9009"); AxPurchTable axPurchTable; AxPurchLine axPurchLine; PurchFormLetter purchFormLetter; purchTable.initFromVendTable(vendTable); axPurchTable = axPurchTable::newPurchTable(purchTable); axPurchTable.parmPurchaseType(PurchaseType::Purch); axPurchTable.parmDocumentStatus(DocumentStatus::PurchaseOrder); axPurchTable.parmAccountingDate(systemDateGet()); axPurchTable.parmDeliveryDate(systemdateget()); axPurchTable.parmPurchStatus(PurchStatus::Backorder); axPurchTable.doSave(); PurchLine.initFromPurchTable(purchTable); axPurchLine = AxPurchLine::newPurchLine(purchLine); axpurchLine.parmItemId(78788); axP...