this is an old article that I posted on wordpress you can visit the old article here
while Im doing inventory calculation
Im searching on net, why it would happen, it happens because The error always occurs when it is trying to pass an adjustment through a production order (“Batch order”). Every other month we encounter this issue so we customized it to tell us the production order number
for reference by dynamics ax trix: click here, but it only solved on ax 2009, not on ax 2012
so i need to figure other alternative solution about this case because I am using ax 2012 (note: the solution may different by any case)
and my solution is:
- check if the item in production type is formula or not, if not, change it to formula
- open code \Classes\InventCostItemDim.addFormulaKeyAdjustment()
- see line containing “throw error(“@PRO997″);”
- this error happens while it has difference adjustment and amount that allocate because of rounding
- the solution key is in 2 classes that must be modified just like the picture below:
after the code change, i do resume calculation, and this is what happened.
Conclusion : the problem is because rounding problem, decround, putting syntax decround in x++ on wrong line can cause alot of problem,
but be careful, what I did is changing source in sys and fpp layer, please ask your consultant before changing this layer
please have a comment
Can you please send me the entire code change, the screen shot doesn’t cover the full code.
Also noticed the method is different than what I have in my environment did you install any KB as well for the extra lines (I am using the same environment i.e. AX 2012 R3).
Will be great if you can send me the xpo copies or X++ codes for the same.
Hi Metthu,
the solution are in
1. classes\inventcostitemdim\addformulakeyadjustment
– the point is we must convert adjAmt into Currency type amount
2. classes\ledgervouchertransobject\checkrounding
– the point is making validation by rounding down because the ax only have 2 digit for currency rounding
Im using ax 2012 FP, CU 6 no installed any KB,
this is source of checkrounding function