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 parameter
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();
Thanks for Sharing such an amazing article. Keep working... Your Site is very nice, and it's very helping us.. this post is unique and interesting, thank you for sharing this awesome information
ReplyDeletePM Employment Generation Programme Scheme | PMEGP