Posts

Showing posts from August, 2020

How to get on hand inventory quantity or Available physical quantity of item in D365

Below function returns onhand qty of item. You can further filter on hand qty of the item for a location by passing invent location id as its optional paramete r public InventQtyAvailPhysical onHandQty()     {         InventDimParm        inventDimParm;         InventDim            inventDim;         Qty                   AvailablePhysical ;         inventDim = InventDim ::find( this .InventDimId);//invent dim ID         inventDimParm.initFromInventDim( InventDim ::find(inventDim.inventDimId));          AvailablePhysical = InventSum ::findSum( this .ItemId,inventDim,inventDimParm).availPhysicalCalculated();           return   AvailablePhysical ;      } // (or) InventOnhand InventOnhand; InventOnhand = InventOnhand ::newItemId( "ItemId" ); InventOnhand.parmInventDimId( "InventDimId" ); InventOnhand.availPhysical();