web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / NevoiTech AX Blog / Get on hand inventory (quan...

Get on hand inventory (quantity) of an item using x++

Moeen Ahmed Sultan Profile Picture Moeen Ahmed Sultan 1,402

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:

  1. ItemId
  2. 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

Share on Facebook
Share on LinkedIn
Share on Twitter
Share on Google+
Share on Skype

The post Get on hand inventory (quantity) of an item using x++ appeared first on NevoiTech Blog.

Comments

*This post is locked for comments