just to complete my solution i have notice that my BPM code is not catering for more than one record in PartWhse which is logicly wrong, so i have updated it to do that:
Erp.Tables.PartWhse PartWhse;
decimal dTTLOnHandQty = 0;
decimal dTTLDemandQty = 0;
foreach (var PartWhse_iterator in (from PartWhse_Row in Db.PartWhse
where PartWhse_Row.Company == Session.CompanyID
&& PartWhse_Row.PartNum == ipPartNum
select PartWhse_Row).ToList())
if (PartWhse_iterator != null)
{
dTTLOnHandQty = dTTLOnHandQty + PartWhse_iterator.OnHandQty;
dTTLDemandQty = dTTLDemandQty + PartWhse_iterator.DemandQty;
}
if(dTTLDemandQty >= dTTLOnHandQty)
{
callContextBpmData.Number01=0;
}
else
{
callContextBpmData.Number01=dTTLOnHandQty-dTTLDemandQty;
}