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 find inventlocationid from itemid (InventTable) ?

(0) ShareShare
ReportReport
Posted on by

How to find inventlocationid from itemid (InventTable) ? 

*This post is locked for comments

  • Zeeshan Adeel Profile Picture
    on at
    RE: How to find inventlocationid from itemid (InventTable) ?

    look at the inventlocationid display method in inventtable.

  • Suggested answer
    dasdasd Profile Picture
    on at
    RE: How to find inventlocationid from itemid (InventTable) ?

    Hi,

    You can get this by following code.

    InventTable                 inventTable = inventTable::find('YourItemID');

    InventItemOrderSetupType    setupType   = InventItemOrderSetupType::Invent;

    InventDim                   inventDim;

       // Default Site

       inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType).inventSiteId(inventDim.InventSiteId, inventTable);

       // Default Location

       inventDim.InventLocationId  = inventTable.inventItemOrderSetupMap(setupType,

                                                                         InventDim::findOrCreate(inventDim).InventDimId)

                                                                         .inventLocationId(inventDim.InventLocationId,

                                                                                           inventTable,

                                                                                           inventDim.InventSiteId);

    // Find Default Item Dimension

       inventDim = InventDim::findOrCreate(inventDim);

       info(strFmt('Warehouse Id: %1', inventDim.InventLocationId));

    Regards,

    Tabsheer

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)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans