BPM Mass Receipt vs New Receipt Line

Anybody successfully able to create a BPM(s) that works in both Mass Receipt vs Receipt Line.

I am trying to update a Part_UD field with OurQty from the receipt.
If I use GetDtlQtyInfo it works correctly and updates for each new receipt line, but if it is a mass receipt it updates all parts with the last quantity changed.

Now the Mass Receipt after calling GetDtlQtyInfo then calls CommitRcvDtl.
If I put my BPM on that Method it works correctly for the Mass Receipt, but obviously not when each line is received as it is not called then.

For simplicity and testing I was just updating the NetWeight field. Below is on CommitRcvDtl. The only difference for the GetDtlQtyInfo is that netWeight = ttRcvDtlRow.OurQty since it is 0 on the mass receipt until committed.

Erp.Tables.Part Part;

foreach(var ttRcvDtl_Row in ttRcvDtl)

{
using (var txscope = IceDataContext.CreateDefaultTransactionScope())
{
var ttRcvDtlRow = ttRcvDtl_Row;
Part = (from Part_Row in Db.Part.With(LockHint.UpdLock) where string.Compare(Part_Row.PartNum, ttRcvDtlRow.PartNum,true) == 0 select Part_Row).FirstOrDefault();

Part.NetWeight = inputOurQty;
Db.Validate();
txscope.Complete();

}
}

1 Like

This is one problem with method BPMs… in some cases Epicor uses two different methods and therefore you will need to write your BPM two time to use the different datasets.
The other option would be to create a Data BPM that triggers no matter which method fires. this may be the way to go here… create a pre-processing BPM on RcvDtl and have a condition for each ADDED or UPDATED row, and then update the netweight

1 Like