Posts

Showing posts from September, 2017

Hint on debugging sales order posting voucher amount mismatch issue

Image
To debug sales order posting voucher amount mismatch issue, add an info method like below on addTrans method of LedgerVoucherObject. Then will get the infolog as shown below, which helps on finding the item price which is getting posted. Recently I got an issue when Item price was changed after packing slip posting and that resulted in voucher amount mismatch error and this helped.

Code bug on Ax 2009 SP1 product builder

Image
Recently I fixed a code bug on  Ax 2009 SP1 product builder, due to which users where getting compilation error on some product model configurations.

Movement journal creation and posting in X++

Job to create a movement journal and post using X++.     InventJournalTable journalTable;     InventJournalTrans journalTrans;     InventJournalTableData journalTableData;     InventJournalTransData journalTransData;     InventTable inventTable;     InventDim inventDim;     InventJournalCheckPost journalCheckPost = new InventJournalCheckPost();     ;     journalTableData = JournalTableData::newTable(journalTable);     journalTransData = journalTableData.journalStatic().newJournalTransData(journalTrans, journalTableData);     // Init JournalTable     journalTable.clear();     journalTable.JournalId = journalTableData.nextJournalId();     journalTable.JournalType = InventJournalType::Movement;     journalTable.JournalNameId = journalTableData.journalStatic().standardJournalNameId(journalTable.JournalType);   ...

Truncate table using x++

Below job is to truncate VendGroup table using x++.    SqlDataDictionary sqlDataDictionary;     ;     sqlDataDictionary = new SqlDataDictionary();     new SqlDataDictionaryPermission(methodstr(SqlDataDictionary, tableTruncate)).assert();     sqlDataDictionary.tableTruncate(tablenum(VendGroup),false);

Finding tables from a Configuration Key

Below job is to list out the tables from a configuration key.     // The name of the configuration key to be specified here     str                     configKeyName   = "Prod";     Dictionary              dictionary      = new Dictionary();     ConfigurationKeyId      configKeyId     = dictionary.configurationKeyName2Id(configKeyName);     TableId                 tableId;     DictConfigurationKey    dictConfigurationKey;     DictTable               dictTable;     container               keyIds;     int                     i;     ;     if (configKeyId)     { ...