Creating Sales Orders via X++

For beginner AX developers, I’m listing some codes which will help someone to create Sales Orders (Similar can be applied to PO) via X++ codes. This may be helpful to new Developers. [Level 200]Some important Objects which are to be referred and understood are:-Tables\SalesTable-Tables\SalesLine-Tables\InventDim-Tables\CustTable-Tables\InventTable-Classes\SalesTableType {The InventType Hierarchy}Sample Code [Very basic]static void SalesOrderCreation(Args _args){ SalesTable salesTable; NumberSeq NumberSeq; SalesLine salesLine; InventDim IDim; ; ttsbegin; NumberSeq = NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId).numberSequence);//=======Table======= salesTable.SalesId = NumberSeq.num(); salesTable.initValue(); salesTable.CustAccount = “4000”; //Enter Customer AcountsalesTable.initFromCustTable(); salesTable.InventLocationId = “GW”; salesTable.insert(); //========Line======= salesLine.clear(); salesLine.SalesId = salesTable.SalesId; salesLine.ItemId = “IS2082SAIL”; //Enter Item ID IDim.InventColorId =”CU”; //Enter Item DimensionsIDim.InventLocationId = “GW”; IDim = … Continue reading Creating Sales Orders via X++

Post Ledger Transactions via X++

For beginner AX developers, I’m listing some codes which will help someone to post ledger transactions via X++ codes. This may be helpful to new Developers. [Level 200] There are two ways to be considered when posting transactions:1. Use the LedgerVoucher class and sub-classes API. 2. Use a journal Classes. 1. Use the LedgerVoucher class and sub-classes API. The Classes are:• LedgerVoucher – Posting {LedgerVoucher harnesses the posting of multiple vouchers at a time. }• LedgerVoucherObject – Voucher {The LedgerVoucher class holds all the vouchers in temporary storage.}• LedgerVoucherTransObject – Transactions {Holds transactions in each Voucher} Instantiation of LedgerVoucher LedgerVoucher::newLedgerPost(_detailSummary,_sysModule,_voucherSeriesCode,[_transactionLogType,_transactionLogText,_approveJournal,_posting]); … Continue reading Post Ledger Transactions via X++

NumberSequences:: Deep Dive

Previously I had posted about how to create new NumberSequences in AX for both existing & new modules. I’ll share some important objects about NumberSequences.Number sequences handle the automatic allocation of ID numbers, vouchers, andjournal numbers.A number sequence is created under MAIN MENU->BASIC->SETUP->NUMBERSEQUENCES->NUMBER SEQUENCE.From a developers point of view, these are the tables which are important.• NumberSequenceTable contains the definitions of each number sequence.• NumberSequenceList holds numbers for continuous number sequences that have not been completed or are currently reserved.• NumberSequenceReference holds which number sequence is used for which function.• NumberSequenceGroup is a list of number sequence groups. • NumberSequenceGroupRef … Continue reading NumberSequences:: Deep Dive