// Get Inventory Dimension From ItemID ... Site,warehouse,Config,Dimid
static void GetInventoryDimensions(Args _args)
{
InventTable inventTable = inventTable::find('1005');
InventItemOrderSetupType setupType = InventItemOrderSetupType::Invent;
InventDim inventDim;
;
inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType).inventSiteId(inventDim.InventSiteId, inventTable);
inventDim.InventLocationId = inventTable.inventItemOrderSetupMap(setupType,
InventDim::findOrCreate(inventDim).InventDimId)
.inventLocationId(inventDim.InventLocationId,
inventTable,
inventDim.InventSiteId);
inventDim.ConfigId = inventTable.StandardConfigId;
inventDim = InventDim::findOrCreate(inventDim);
info(strFmt('Invent Dim. Id: %1', inventDim.inventDimId));
info(strFmt('Site Id: %1', inventDim.InventSiteId));
info(strFmt('Warehouse Id: %1', inventDim.InventLocationId));
}
static void GetInventoryDimensions(Args _args)
{
InventTable inventTable = inventTable::find('1005');
InventItemOrderSetupType setupType = InventItemOrderSetupType::Invent;
InventDim inventDim;
;
inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType).inventSiteId(inventDim.InventSiteId, inventTable);
inventDim.InventLocationId = inventTable.inventItemOrderSetupMap(setupType,
InventDim::findOrCreate(inventDim).InventDimId)
.inventLocationId(inventDim.InventLocationId,
inventTable,
inventDim.InventSiteId);
inventDim.ConfigId = inventTable.StandardConfigId;
inventDim = InventDim::findOrCreate(inventDim);
info(strFmt('Invent Dim. Id: %1', inventDim.inventDimId));
info(strFmt('Site Id: %1', inventDim.InventSiteId));
info(strFmt('Warehouse Id: %1', inventDim.InventLocationId));
}
No comments:
Post a Comment