Thursday, June 14, 2018

Unit conversion AX 2012/ D365FO

Code below can be used for unit conversion with rounding.
 public SalesQty dtConvert(Qty _salesQty,ItemId _itemId,SalesUnit _inventUnit,SalesUnit _salesUnit )  
 {  
      SalesQty salesQty;  
      salesQty = UnitOfMeasureConverter::convert(_salesQty,  
               UnitOfMeasure::unitOfMeasureIdBySymbol(_inventUnit),  
               UnitOfMeasure::unitOfMeasureIdBySymbol(_salesUnit),  
               NoYes::Yes,  
               InventTable::itemProduct(_itemId),  
               NoYes::Yes);  
     return salesQty;  
 }  

No comments:

Post a Comment

Reindexing Dynamis AX database

Below script will create job to re-index and update statistics of dynamics ax database. In script below fill factor is used as 30%, revie...