Get on hand inventory (quantity) of an item using x++
Views (1089)
Getting the on hand inventory is always a headache because there is no field in the table which gives the on hand inventory. So, to tackle this issue I am sharing this function. It gets two arguments which are as follows:
- ItemId
- InventDimId
It returns on hand inventory.
public InventQtyAvailPhysical onHandInventory(ItemId _itemId, InventDimId _inventDimId)
{
InventOnhand inventOnhand;
InventDim inventDim = inventDim::find(_inventDimId);
InventDimParm inventDimParm;
inventDimParm.initFromInventDim(inventDim);
inventOnhand = InventOnhand::newParameters(_itemId, inventDim, inventDimParm);
return inventOnhand.availPhysical();
}
Moreover, you can also explore more functions and tricks. Kindly share them in comments.
GitHub: Click here
A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty. – Winston Churchill
The post Get on hand inventory (quantity) of an item using x++ appeared first on NevoiTech Blog.

Like
Report




*This post is locked for comments