Skip to main content

Notifications

Microsoft Dynamics AX forum
Suggested answer

How to fetch available physical value in ax2012

Posted on by 6
Hello Techies,
 
can anyone please help me with how to fetch available physical qty through code?
 
  • Martin Dráb Profile Picture
    Martin Dráb 225,202 Super User on at
    How to fetch available physical value in ax2012
    The code is correct; trying to find some other code would be a waste of time. You'll need to investigate what's wrong in how you're using the code.
     
    First of all, make sure you're providing a valid item ID and InventDim buffer. Check out which dimension values are there in the InventDim buffer, if any. Also, make sure that there really physical quantity (in the company where you're executing your code) for the given item and inventory dimensions. Maybe the result you're getting is correct.
  • CU22051035-0 Profile Picture
    CU22051035-0 6 on at
    How to fetch available physical value in ax2012
    Hello Martin,
     
    I tried this code before, but getting 0 value as i am not getting record in inventDimParm. 
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 225,202 Super User on at
    How to fetch available physical value in ax2012
    There is InventOnhand class for this purpose. For example:
    InventOnhand inventOnhand;
    InventDimParm inventDimParm;
    
    inventDimParm.initFromInventDim(inventDim);
    inventOnhand = InventOnhand::newParameters(itemId, inventDim, inventDimParm);
    inventOnhand.availPhysical();

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,217 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,202 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans