Dear All, I find a strange Cost Amount issue which I want to share with you all,
The client want to get the wt.avg. cost price while creating the lines in Inventory Journal Movements. So I add a simple code to resolve the issue. InventJournalTrans.CostPrice = InventSum::find(InventJournalTrans.ItemId, InventJournalTrans.InventDimId).costPricePcs(); InventJournalTrans.CostAmount= InventJournalTrans.CostPrice * InventJournalTrans.CostPrice; But the result was strange eg. 5.26 (Cost Price) * 165(Quantity) = 867.74 (Cost Amount) where as the value should come 867.90 (Cost Amount) Due to this issue client can't post the movement, info log shows "Invalid rounding error " So unless I change the coding to get the CostAmount directly from a method building in AX it didn't work. InventJournalTrans.CostPrice = InventSum::find(InventJournalTrans.ItemId, InventJournalTrans.InventDimId).costPricePcs(); InventJournalTrans.CostAmount=InventJournalTrans.calcCostAmount(); But my question is why it so, why the multiplication doesn't give correct result when done through code and by not using the standard AX calc method. Hussain Sharza 0563884455 (KSA)