Weights on Customer Shipment

Hello everyone.

Anyone able to help me resolve an issue?

We have a part T200 which will not have any data in Part.NetWeight on the Part Master table.We then have a part S2112 which will have data in Part.NetWeight. I have added a custom UD field to Order Entry of the following CustomWeight_c which goes to Customer Shipment Entry for that given line and it’s given CustomWeight_c

Here is my BPM on Erp.CustShip.Update / Post-Processing

var CalcWeight = (from shipDtl in Db.ShipDtl
                   join orderDtl in Db.OrderDtl on new { shipDtl.Company, shipDtl.OrderNum, shipDtl.OrderLine } equals new { orderDtl.Company, orderDtl.OrderNum, orderDtl.OrderLine}
           join part in Db.Part on  new { shipDtl.Company, shipDtl.PartNum } equals new { part.Company, part.PartNum } into partleft from part in partleft.DefaultIfEmpty()
                   where shipDtl.PackNum == PackNum
                   select shipDtl.SellingInventoryShipQty * (part.NetWeight != 0 ? part.NetWeight : orderDtl.CustomWeight_c)
                   ).ToList().Sum();

using (var txScope = IceContext.CreateDefaultTransactionScope())
{

foreach (var ShipDtl in (from ShipDtlRow in Db.ShipDtl
where ShipDtlRow.Company == Session.CompanyID 
&& ShipDtlRow.PackNum == PackNum
select ShipDtlRow))
{
TotalWeight = Convert.ToDecimal(CalcWeight);
ShipDtl["ShippedWeight_c"] =  Convert.ToDecimal(CalcWeight); 
}


 Db.Validate();
 txScope.Complete();
}   

But it will not run if there is Part.NetWeight and CustomWeight_c both filled in. We have to choice either or…

Can anyone think of another way of doing it?

What is the desired outcome you are trying to solve for? I read your statement at the bottom, but what does the business/user want it to do. Allow them to pick? Prioritize one over the other? Not sure I hear the problem, or what your solution isn’t solving.