Announcements
No record found.
How to find inventlocationid from itemid (InventTable) ?
*This post is locked for comments
look at the inventlocationid display method in 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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.