Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 10657

Get unit conversion value of item in Ax 2012

$
0
0
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)));


Viewing all articles
Browse latest Browse all 10657

Trending Articles



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