Check a PartLot field on customer shipment

I am trying to write a BPM to see if a field is checked off on the part lot table for the lot being shipped. I have gotten the code to pass the syntax test but it shows the error pop up each time, even when the box isn’t checked.

string MSG = string.Empty;
Erp.Tables.PartLot PartLot;

var ShipDtlRow = ttShipDtl.FirstOrDefault();

PartLot = (from pl in Db.PartLot.With(LockHint.UpdLock) where pl.Company == ShipDtlRow.Company && pl.PartNum == ShipDtlRow.PartNum && pl.LotNum == ShipDtlRow.LotNum select pl).FirstOrDefault();

if(PartLot.OpenPRR_c == true)
  MSG = "You can't ship this part. There is an open PRR";

Have you used a message box to validate the partlot record you are pulling? Most of these times I find myself bashing my head into a wall yelling at Epicor, when its the record that was right

@MelissaC There are a few things that code will need to loop and check all PartLots. The attached bpm uses widgets and does a check on GetByID when a pack is opened to alert that we need to confirm UL labels are on the product. You should be able to change the query to use PartLot instead of Part.

Check Part.bpm (38.5 KB)

Thanks for the help but I can’t import the BPM because the version is greater than my current version. :frowning:

I added the info after my message. Not what I was expecting…


1 Like

@MelissaC Here are some screenshots of a simulation I did of your bpm. The hardest thing about what you are wanting is that the check on getbyid has to be post processing so an exception won’t stop anything there. You can do a message but not likely a stoppage of processing. Assuming you use QuickShip you can stop the transaction in ChangeStatus when the pack is being closed. If they can’t close the pack then they can’t freight it.


PartLot bpm.docx (276.2 KB)


Thank you. I don’t know why I always forget about the BAQ option. I am much more comfortable with that than custom coding.