Public boolean SAN_validateProductAssortment(Str _itemId)
{
RetailAssortmentTable retailAssortmentTable;
RetailChannelAssortedProductView retailChannelAssortedProductView;
InventTable inventTable;
while select retailAssortmentTable
{
select firstonly retailChannelAssortedProductView
exists join inventTable
where inventTable.ItemId == _itemId
&& retailChannelAssortedProductView.AssortmentRecId == retailAssortmentTable.RecId
&& retailChannelAssortedProductView.ProductID == inventTable.Product
&& retailChannelAssortedProductView.InventLocationDataAreaId == inventTable.DataAreaId;
if(retailChannelAssortedProductView)
{
return true;
}
}
}
throw Error("Invalid item to sell based on assortments");
}