public void checkMandatoryProductDimensions(ItemId _itemId)
{
InventTable inventTable = InventTable::find(_itemId);
EcoResProductDimensionGroup ecoResProductDimGroup;
EcoResProductDimensionGroupSetup dimGroupSetup;
if (inventTable)
{
// Get the Product Dimension Group linked to the Item
select firstonly ecoResProductDimGroup
where ecoResProductDimGroup.RecId == inventTable.ProductDimensionGroup;
if (ecoResProductDimGroup)
{
// Join the setup table to see which dimensions are active/mandatory
while select dimGroupSetup
where dimGroupSetup.ProductDimensionGroup == ecoResProductDimGroup.RecId
{
if (dimGroupSetup.IsActive)
{
Info(strFmt("Dimension: %1 | Is Mandatory: %2",
dimGroupSetup.DimensionAttribute,
dimGroupSetup.IsMandatory ? "Yes" : "No"));
}
}
}
else
{
Warning("No Product Dimension Group assigned to this item.");
}
}
}
No comments:
Post a Comment