static void Dev_CreatePO_and_Invoice(Args _args) { NumberSeq numberSeq; Purchtable Purchtable; PurchLine PurchLine; PurchFormLetter purchFormLetter; ; ttsbegin; numberSeq = NumberSeq::newGetNumFromCode(purchParameters:: numRefPurchaseOrderId(). NumberSequence,true); // Initialize Purchase order values Purchtable.initValue(); Purchtable.PurchId = numberSeq.num(); Purchtable.OrderAccount = '3000'; Purchtable.initFromVendTable() ; if (!Purchtable.validateWrite()) { throw Exception::Error; } Purchtable.insert(); // Initialize Purchase Line items PurchLine.PurchId = Purchtable.PurchId; PurchLine.ItemId = 'B-R14'; PurchLine.createLine(true, true, true, true, true, false); ttscommit; purchFormLetter = purchFormLetter::construct( DocumentStatus::Invoice); purchFormLetter.update( purchtable, // Purchase record Buffer "Inv_"+purchTable.PurchId, // Invoice Number systemdateget()); // Transaction date if (PurchTable::find(purchTable. PurchId).DocumentStatus == DocumentStatus::Invoice) { info(strfmt("Posted invoiced journal for purchase order %1",purchTable.PurchId)); } }
Tuesday 7 January 2014
Create Purchase Order_and_Invoice in ax 2012
Subscribe to:
Post Comments (Atom)
SQL/SSRS Interview questions I thought of blogging some SQL/SSRS interview questions.
Below are some. I will add more, when I complete the compilation 1. What is OLTP(Online Transaction Processing)? OLTP stands ...
-
static void WriteTextfile(Args _args) { CustTable custTable; BinData binData; TextBuffer textBuffer; ; ...
-
class ExcelExport { } and right click and select new method and type the code as follows public static void main(Args args) { Cust...
-
Dynamics AX 2012 - Data Import Using Excel Add IN With the release of Dynamics AX 2012, a very important thing was to import data ...
No comments:
Post a Comment