Posts

Showing posts from December, 2016

Dynamics AX 2009 : Cannot create a record in Sales order header - Updating table (SalesParmSubTable)

During Sales order posting I encountered an issue which was being generated due to below error message: "Cannot create a record in Sales order header - Updating table (SalesParmSubTable). Sales order:*, *. The record already exists." After some analysis and searching this issue I found that this issue sometimes occurs due to database logging enabled on some tables related to Sales Order i.e. SalesParmSubTable, SalesParmSubLine, SalesParmTable,SalesParmUpdate .... Removing these tables from that specific Company Database log setup resolved the issue. Note: For similar issue related to PO I also found a Microsoft fix which may also be helpful in similar scenarios: https://support.microsoft.com/en-us/kb/961909

Dynamics AX X++ job to fetch On Hand Item data on bases of Inventory dimensions

Static void onHandJob(Args _args) { InventOnhand    inventOnhand;     InventDim       InventDimLocal;     InventSum       InventSumLocal;     ItemID          itemId,ItemIdLocal;     InventDimParm   inventDimParmLocal;     InventBatch     inventBatchLocal; itemid = wmsPickingList_OrderPickTmp.ItemId;     while select InventSumLocal             group by InventSumLocal.ItemId, InventDimLocal.inventBatchId,                      InventDimLocal.wmsLocationId, InventDimLocal.LicensePlateId         where InventSumLocal.Closed == NoYes::No               && InventSumLocal.ClosedQty == NoYes::No               && InventSumLocal.ItemId == itemid         join InventDimLocal             where InventDimLocal.inventDimId == InventSumLocal.InventDimId                   && InventDimLocal.inventBatchId != ""                   && InventDimLocal.wmsLocationId !=""         {             inventBatchLocal = InventBatch::find(inventDimLoca