Skip to main content

Posts

Showing posts from June, 2016

Solved Error during Inventory Closing and Recalculation in Ax 2012

Getting following Error during Inventory Closing and Recalculation in Ax 2012. Error Details: "You can't have unallocated cost on a planning formula" Solution : This error may come many ways. First check the item in production type is formula or not, if not, change production type to formula. Then you can debug following method in class InventCostItemDim  \Classes\InventCostItemDim.addFormulaKeyAdjustment() To get any error due to rounding you can check ledgervouchertransobject class in checkrounding method. Then you can correct rounding issue. If still error exist then find the recid by debugging on error editing message and find that record in inventtrans table. If in inventtrans table valueopen field if its yes then select no this option you can use only if there is no other solution you found.

Get unit conversion value of item in Ax 2012

To Get unit conversion value of item in Ax 2012 you can use below code. UnitOfMeasureConverter_Product is a class which has different method to give you converted value. Here example is showing to get conversion value from liter to kilo gram. UnitOfMeasureConverter_Product unitConverter = UnitOfMeasureConverter_Product::construct(); unitConverter.parmProduct(InventTable::find("TestIte",true).Product); unitConverter.parmFromUnitOfMeasure(UnitOfMeasure::unitOfMeasureIdBySymbol("ltr")); unitConverter.parmToUnitOfMeasure(UnitOfMeasure::unitOfMeasureIdBySymbol("kg")); unitConverter.parmRoundAbsoluteValue(NoYes::Yes); unitConverter.parmApplyRounding(NoYes::Yes); info(strFmt("%1",unitConverter.convertValue(1)));