Posts

Showing posts from October, 2018

How to create Movement Journal with Code X++ Sale Order

Sometime we need to make leftover quantity of Inventory at the time of Sale Order. I created a code to use to make a movement journal in Ax 2009. void clicked() {    InventJournalTable journalTable;    InventJournalTable InventJournalTable_;    SalesTable SalesTable_; InventJournalTrans journalTrans; InventJournalTableData journalTableData; InventJournalTransData journalTransData; Salesline _Salesline; //alesline Salesline; InventDim _inventDim; numberSeq numberSeq; NumberSequenceReference NumberSequenceReference; Counter cnt; InventJournalCheckPost journalCheckPost = new InventJournalCheckPost(); ; if((SalesTable::find(Salesline.SalesId).RefJournalID) != '') { info(SalesTable::find(Salesline.SalesId).RefJournalID); info('Journal is already Created'); } else { select sum(RemainSalesPhysical) from _SalesLine where _SalesLine.SalesId == Salesline.SalesId; if (_SalesLine.RemainSalesPhysical != 0) { select * from _SalesLine wher...

X++ to C# Comparisons

Differences The following table lists X++ features that are different in C#. Feature X++ C# Comments Declarations All declarations must be at the start of the method, before any X++ statements. Declarations can occur anywhere in the method. Both languages permit multiple variables of the same type to be listed together in one declaration. Both languages allow you to assign an initial value in the declaration statement. if  and  else conditional statements The  if  statement accepts any type of expression that it can automatically convert to a Boolean. Common examples include an  int  for which 0 means false, or an object for which null means false. The  if  statement requires a Boolean expression. The syntax structure regarding curly braces and parentheses is exactly the same between X++ and C#. Literal string A literal string can be delimited by either of the following: A pair of double quotation mark (") characters. A pair of singl...