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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to calculate physical available of an item given the inventLocationId that shown on the on hand form?

(0) ShareShare
ReportReport
Posted on by 817

Hi,

May I know how can I calculate the physical available quantity shown on the item on hand form given the warehouse(inventLocationId)?

 

Thanks.

 

Cheers,

John

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Lauras U Profile Picture
    955 on at
    Re: How to calculate physical available of an item given the inventLocationId that shown on the on hand form?

    Try this:

       InventDimParm       invDimParm;

       InventDim           invDim;

       Qty                 availPhys;

       ;

       invDim.InventLocationId = 'INVENTLOCATIONID';

       invDim = InventDim::findOrCreate(invDim);

       invDimParm.initFromInventDim(InventDim::find(invDim.inventDimId));

       availPhys = InventSum::findSum("ITEMID",invDim,invDimParm).availPhysical();

       info(strfmt("availPhys:%1 ",availPhys));

  • Brandon Wiese Profile Picture
    17,788 on at
    Re: How to calculate physical available of an item given the inventLocationId that shown on the on hand form?

    There is also a class approach that works in cases where the previous example does not.  For example, in the middle of a transaction where the item's onhand has already been modified (such as during a packing slip posting), the straight InventSum will return an incorrect result.  The InventOnhand class takes into account uncommitted onhand changes when they exist.

       InventDim           inventDim;

       InventDimParm       inventDimParm;

       InventOnhand        inventOnhand;

       ;

       inventDim.InventLocationId = 'Yourwarehouse';

       inventDimParm.initFromInventDim(inventDim);

       inventOnhand = InventOnhand::newParameters('Youritem', inventDim, inventDimParm);

       info(strfmt("Available Physical: %1", inventOnhand.availPhysical()));

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans