Quantcast
Channel: Microsoft Dynamics AX
Viewing all articles
Browse latest Browse all 101540

Forum Post: Inventory movement journal coming in as an adjustment

$
0
0
Hi - This problem is driving me nuts... I don't know how to fix it. I'm trying to create an inventory movement journal entry using the ProfitLossJournalService. The code below runs, but it shows the transaction in the "inventory adjustment" journal. I want it in the inventory movement jounal. public void UpdateInventoryForConsumableItem(InventoryUpdate update) { var svc = new ProfitLossJournalServiceClient(); var cc = new CallContext {Company = "SS"}; var journal = new AxdProfitLossJournal(); var table = new AxdEntity_InventJournalTable { InventDimFixedSpecified = false, InventSiteId = "MC", InventLocationId = "MAIN WH", JournalType = AxdEnum_InventJournalType.Movement, JournalNameId = "InvMovJour", Description = Constants.InventoryMovementJournalDescription, NumOfLines = 1, NumOfLinesSpecified = true, JournalTypeSpecified = true, JournalId = "InvMovJour", JournalIdOrignal = "InvMovJour", action = AxdEnum_AxdEntityAction.update }; var inventoryDims = new AxdEntity_InventDim { InventLocationId = "MAIN WH", InventDimId = update.InventoryDimId, InventColorId = update.Color, InventSiteId = "MC", InventSizeId = update.Size, InventStyleId = update.Style, action = AxdEnum_AxdEntityAction.create }; var entry = new AxdEntity_InventJournalTrans { InventDimId = update.InventoryDimId, TransDate = DateTime.Now, ItemId = update.ItemId, CostMarkupSpecified = false, InventRefTypeSpecified = false, LineNumSpecified = false, JournalType = AxdEnum_InventJournalType.Movement, JournalTypeSpecified = true, Qty = update.Quantity, QtySpecified = true, InventDim = new AxdEntity_InventDim[1] {inventoryDims} }; table.InventJournalTrans = new[] {entry}; journal.InventJournalTable = new[] {table}; try { var result = svc.create(cc, journal); Logger.LogTrace(string.Format("sending InventoryTransferJournal {0}", result.GetValue(0))); Logger.LogEvent(Logger.SentConsumableInventoryUpdateToDynamics); } catch (Exception e) { Logger.LogException(e); throw; } }

Viewing all articles
Browse latest Browse all 101540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>