# Check a PartLot field on customer shipment

**URL:** <https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610>\
**Category:** Epicor ERP 10\
**Tags:** bpm\
**Created:** [February 17, 2022, 7:57pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610 "2022-02-17T19:57:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MelissaC](https://www.epiusers.help/user_avatar/www.epiusers.help/melissac/32/1982_2.png) [@MelissaC](https://www.epiusers.help/u/MelissaC)\
**Post date:** [February 17, 2022, 7:57pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/1 "2022-02-17T19:57:25Z")

</div>

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.

```cs
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";
    CallContext.Current.ExceptionManager.AddBLException(MSG);
    }
```

---

<div class="post-metadata">

**Author:** ![cfinley](https://www.epiusers.help/letter_avatar_proxy/v4/letter/c/3e96dc/32.png) [@cfinley](https://www.epiusers.help/u/cfinley)\
**Post date:** [February 18, 2022, 3:00pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/2 "2022-02-18T15:00:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [February 18, 2022, 4:47pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/3 "2022-02-18T16:47:51Z")

</div>

@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](https://www.epiusers.help/uploads/short-url/a6hC4cp8WowdR86MxhLXzS0NCBi.bpm) (38.5 KB)

---

<div class="post-metadata">

**Author:** ![MelissaC](https://www.epiusers.help/user_avatar/www.epiusers.help/melissac/32/1982_2.png) [@MelissaC](https://www.epiusers.help/u/MelissaC)\
**Post date:** [February 20, 2022, 3:48pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/4 "2022-02-20T15:48:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MelissaC](https://www.epiusers.help/user_avatar/www.epiusers.help/melissac/32/1982_2.png) [@MelissaC](https://www.epiusers.help/u/MelissaC)\
**Post date:** [February 20, 2022, 4:12pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/5 "2022-02-20T16:12:23Z")

</div>

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

![image](https://www.epiusers.help/uploads/default/original/3X/f/d/fdaecf150b2e397a628f542def39377aedc2f6bc.png)

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [February 20, 2022, 5:38pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/6 "2022-02-20T17:38:31Z")

</div>

@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.

![image](https://www.epiusers.help/uploads/default/original/3X/6/0/60bb7fd8b5c4bafb9630909dcf09c5921e78995d.png)

[PartLot bpm.docx](https://www.epiusers.help/uploads/short-url/1VoyItCNoNPATKqrD2GucREt4p0.docx) (276.2 KB)

---

<div class="post-metadata">

**Author:** ![MelissaC](https://www.epiusers.help/user_avatar/www.epiusers.help/melissac/32/1982_2.png) [@MelissaC](https://www.epiusers.help/u/MelissaC)\
**Post date:** [February 21, 2022, 6:01pm UTC](https://www.epiusers.help/t/check-a-partlot-field-on-customer-shipment/87610/7 "2022-02-21T18:01:46Z")

</div>

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