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...
Technical Tutorials x++,tips on issues or troubleshooting On Ax ERP ,Microsoft Dynamics 365,Ax 2012,Microsoft , U.S.,Business Software solution.