Skip to main content

Posts

Create and posting Sales order through X++ in ax 2012

Create and posting Sales order through X++ in ax 2012 static void  Sale OrderCreate (Args _args) { NumberSeq numberSeq; SalesTable salesTable; SalesLine salesLine; ttsBegin; numberSeq = NumberSeq::newGetNum(SalesParameters::numRefSalesId()); numberSeq.used(); salesTable.SalesId = numberSeq.num(); salesTable.initValue(); salesTable.CustAccount = '1101'; salesTable.initFromCustTable(); if (!salesTable.validateWrite()) { throw Exception::Error; } salesTable.insert(); salesLine.SalesId = salesTable.SalesId; salesLine.ItemId = '1205'; salesLine.createLine(true, true, true, true, true, true); ttsCommit; info(strFmt( "Sales order '%1' has been created", salesTable.SalesId)); } *********************************** static void SalesOrderPost(Args _args) { SalesFormLetter salesFormLetter; salesTable salesTable; salesTable = SalesTable::find('SO-123'); salesFormLetter = SalesFormLetter::construct( DocumentStatus::PackingSlip); salesFormLetter.up...
Recent posts

CREATE AND POSTING PURCHASE ORDER THROUGH X++ IN AX 2012 DYNAMICS AX

CREATE AND POSTING PURCHASE ORDER THROUGH X++ IN AX 2012 DYNAMICS AX   static void PurchOrderCreate(Args _args)   { NumberSeq numberSeq; PurchTable purchTable; PurchLine purchLine; ttsBegin; numberSeq = NumberSeq::newGetNum(PurchParameters::numRefPurchId()); numberSeq.used(); purchTable.PurchId = numberSeq.num(); purchTable.initValue(); purchTable.initFromVendTable(VendTable::find('1001')); if (!purchTable.validateWrite()) { throw Exception::Error; } purchTable.insert(); purchLine.PurchId = purchTable.PurchId; purchLine.ItemId = '1205'; purchLine.createLine(true, true, true, true, true, true); ttsCommit; info(strFmt( "Purchase order '%1' has been created", purchTable.PurchId)); } .............................................. static void PurchOrderPost(Args _args) { PurchFormLetter purchFormLetter; PurchTable purchTable; purchTable = PurchTable::find('000409'); purchFormLetter = PurchFormLetter::construct( D...

Batch Multi threading D365FO AX7

Batch Multi threading D365FO AX7 Normally, when we schedule our RunBaseBatch class as a batch job, it will create single task. Which will responsible to execute complete process in single thread. But, As you know like AX-2009 and AX-2012. In D365FO We can add multiple AOS server in single batch group and they can process the multiple task simultaneously.  In this demo I will show, How to create multi threading Batch job. following are the steps Step-1 Create a table for demo purpose in our demo we keep table name is  SLD_DemoTable . Step-2 create a class with name  SLD_DemoBusinessLogic  and write your business logic in this class. In demo I write only insert records in table and show you guys how it works. Reference Code class   SLD_DemoBusinessLogic {      public   void  processInit( VendTable  _vend)     {          SLD_DemoTable  ...