GetInventoryDimensions using x++ :
static void _GetInventoryDimensions(Args _args)
{
InventTable inventTable = inventTable::find('D0004');
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);
// Default ConfigId
inventDim.ConfigId = inventTable.StandardConfigId;
// Find Default Item Dimension
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('D0004');
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);
// Default ConfigId
inventDim.ConfigId = inventTable.StandardConfigId;
// Find Default Item Dimension
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));
}
0 comments:
Post a Comment