How to find inventlocationid from itemid (InventTable) ?
*This post is locked for comments

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