# BPM Warning on Job Receipt to Inventory - Help Needed

**URL:** <https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339>\
**Category:** Epicor ERP 10\
**Tags:** customization, bpm\
**Created:** [March 5, 2021, 9:26pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339 "2021-03-05T21:26:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgreenEA](https://www.epiusers.help/user_avatar/www.epiusers.help/dgreenea/32/22635_2.png) [@dgreenEA](https://www.epiusers.help/u/dgreenEA)\
**Post date:** [March 5, 2021, 9:26pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/1 "2021-03-05T21:26:03Z")

</div>

I am attempting to create a method directive on ReceiptsFromMFG as a preprocess that will flag the user entering the transaction qty if the trans qty + previous qtys \> Job Production Qty.

I need assistance creating a sum for previous transactions.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![dgreenEA](https://www.epiusers.help/user_avatar/www.epiusers.help/dgreenea/32/22635_2.png) [@dgreenEA](https://www.epiusers.help/u/dgreenEA)\
**Post date:** [March 8, 2021, 4:26pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/2 "2021-03-08T16:26:41Z")

</div>

I have thus far came up with the following custom code that should do exactly what I’m after:

```
foreach (var PartTran_iterator in (from r in ttPartTran where r.Added() || r.Updated() select r))
{
  if(PartTran_iterator!=null)
  {
    decimal QtyReceived = 0;
    decimal ProdQty = 0;
    
    var Job = (from s in Db.JobHead where s.Company == Session.CompanyID && s.JobNum == PartTran_iterator.JobNum select s).FirstOrDefault();
    if (Job != null)
    {
      ProdQty = Job.ProdQty;
       
      foreach (var PartTran2_iterator in (from v in Db.PartTran where v.Company == Session.CompanyID && v.JobNum == Job.ToString() && v.TranType == "MFG-STK" select v))
      {
        QtyReceived = QtyReceived + PartTran2_iterator.TranQty;
      }
        
      if((QtyReceived + PartTran_iterator.TranQty) > ProdQty)
      {
        asdf = 1;
      }
    }
  }
}

```

Credit Here:

> [@BPM code to check job Receipts to InventoryQty](https://www.epiusers.help/t/bpm-code-to-check-job-receipts-to-inventoryqty/41319):
>
> Would anyone help me sort out a BPM which I plan to check quantity when executing job receipt to inventory. Our warehouse staff have no restriction or checking about receive quantity main menu --\> material management --\> inventory management --\> general operations --\> job receipt to inventory What would be the BPM code to check the quantity entered exceeds the Qty Completed.

However, when I go to receive the job to inventory I get the following message:

![image](https://www.epiusers.help/uploads/default/original/3X/9/3/93eafb4bd587d65a50057609579efc34f7870448.png)

I am unsure as to why I am receiving this message and would like some assistance troubleshooting. Additionally, I would like the custom code to prompt the user for a yes or no to a continue anyway ststement. Has anyone accomplished this before?

---

<div class="post-metadata">

**Author:** ![dgreenEA](https://www.epiusers.help/user_avatar/www.epiusers.help/dgreenea/32/22635_2.png) [@dgreenEA](https://www.epiusers.help/u/dgreenEA)\
**Post date:** [March 8, 2021, 6:32pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/3 "2021-03-08T18:32:43Z")

</div>

Ended up axing most of the code and instead opted to get only the transaction history through the second for each statement.

Now I need to come up with a way of having an ok and a cancel button on the bpm form. Anyone know a quick way to get that setup?

---

<div class="post-metadata">

**Author:** ![Nancy\_Hoyt](https://www.epiusers.help/user_avatar/www.epiusers.help/nancy_hoyt/32/17746_2.png) [@Nancy\_Hoyt](https://www.epiusers.help/u/Nancy_Hoyt)\
**Post date:** [March 8, 2021, 6:54pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/4 "2021-03-08T18:54:46Z")

</div>

Hi Dylan,

Here are some screenshots to help get you moving:

 ![image](https://www.epiusers.help/uploads/default/original/3X/a/4/a45b5843c3ab7812da48ef2b3d1df87afc598fb0.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/1/c/1c67ad4398de4a4266560dbd3123487813e5cccb.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/5/7/57c19ca49cf15a3ea2c0a4d00b481f48d1206632.png)

Nancy

---

<div class="post-metadata">

**Author:** ![dgreenEA](https://www.epiusers.help/user_avatar/www.epiusers.help/dgreenea/32/22635_2.png) [@dgreenEA](https://www.epiusers.help/u/dgreenEA)\
**Post date:** [March 8, 2021, 7:48pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/5 "2021-03-08T19:48:27Z")

</div>

That seemed to do the trick. Next question I have is how do I get call context passed over to the form?

---

<div class="post-metadata">

**Author:** ![dgreenEA](https://www.epiusers.help/user_avatar/www.epiusers.help/dgreenea/32/22635_2.png) [@dgreenEA](https://www.epiusers.help/u/dgreenEA)\
**Post date:** [March 8, 2021, 8:16pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/6 "2021-03-08T20:16:55Z")

</div>

Ended up just making another custom code module to assign scalar values to the call context there and added in the call context to the message on the form.

Thanks for the help Nancy! Credit to you.

---

<div class="post-metadata">

**Author:** ![SJordan](https://www.epiusers.help/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@SJordan](https://www.epiusers.help/u/SJordan)\
**Post date:** [December 19, 2023, 6:54pm UTC](https://www.epiusers.help/t/bpm-warning-on-job-receipt-to-inventory-help-needed/76339/7 "2023-12-19T18:54:53Z")

</div>

Dylan,

I was wondering if you would be willing to share the code that you ended up with on the BPM Warning on Job Receipts?
