web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Get unit conversion value of item in Ax 2012

SANTOSH KUMAR SINGH Profile Picture SANTOSH KUMAR SINGH 1,224
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)));


This was originally posted here.

Comments

*This post is locked for comments