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

Announcements

No record found.

News and Announcements icon
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
    335 on at

    look at the inventlocationid display method in inventtable.

  • Suggested answer
    dasdasd Profile Picture
    841 on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans