Skip to main content

Posts

Showing posts from June, 2019

Code to Convert Inventory to sales unit value for Item in Axapta

This is a sample Code to Convert Inventory to sales unit value for Item in Axapta . You can try this code in job to check the value. Item code you can use from your system data. I hope you will get idea and enjoy daxing. InventTableModule InventTableModule; int64 InvUnit, SalesUnit, EcoresproductRecid; UnitOfMeasureConversion UnitOfMeasureConversion; real d; select InventTableModule where InventTableModule.ItemId == '60068C' && InventTableModule.ModuleType == ModuleInventPurchSales::Invent; InvUnit = UnitOfMeasure::findBySymbol(InventTableModule.UnitId).RecId; SalesUnit = UnitOfMeasure::findBySymbol('BOX4').RecId; EcoresproductRecid = EcoResProduct::findByDisplayProductNumber('60068C').RecId; d = UnitOfMeasureConverter::convert(8.0,InvUnit,SalesUnit,NoYes::No,Ecoresproductrecid); info(strFmt("%1",d));

How to Set default value in Ax form Lookup

Problem :I need string-edit lookup display by default the code '00002' and not the '00001.How can i do this using axapta code? Solution  : Instead of asking 00002 as default in the lookup, you can set '00002' as the default value of the field on the form. Otherwise, if you don't like to have '00001' in the lookup then you need to write dynamic lookup on that field.