# BPM is interfering with serial numbers

**URL:** <https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680>\
**Category:** Epicor ERP 10\
**Tags:** serial-numbers, bpm, multi-serial-nums\
**Created:** [January 22, 2019, 2:19pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680 "2019-01-22T14:19:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valentina](https://www.epiusers.help/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@Valentina](https://www.epiusers.help/u/Valentina)\
**Post date:** [January 22, 2019, 2:19pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/1 "2019-01-22T14:19:24Z")

</div>

We have a BPM to prevent overbooking labour quantity. We are also testing introduction of Serial Numbers in production.  
The BPM somehow interfere with the serial numbers and when booking a quantity of more than 1, with allocated serial number, it stops the process and triggers an error:

Business Layer Exception

More than one entry for T50010 is not allowed

Exception caught in: Epicor.ServiceModel

Error Detail  
============More than one entry for T50010 is not allowed  
Description:  
Program: Erp.Services.BO.Labor.dll  
Method: validateSerial  
Line Number: 17283  
Column Number: 21  
Table: LbrScrapSerialNumbers  
[…]

The custom code used in the BPM is below:

```cs
Erp.Tables.JobOper JobOper;
 var ttLaborDtl_xRow = (from ttLaborDtl_Row in ttLaborDtl select ttLaborDtl_Row).FirstOrDefault();
 
 if (ttLaborDtl_xRow != null)
 
     {
         var JobOper_xRow = (from JobOper_Row in Db.JobOper where JobOper_Row.JobNum == ttLaborDtl_xRow.JobNum && JobOper_Row.OprSeq == ttLaborDtl_xRow.OprSeq && JobOper_Row.Company == ttLaborDtl_xRow.Company && JobOper_Row.AssemblySeq == ttLaborDtl_xRow.AssemblySeq select JobOper_Row).FirstOrDefault();
 
       callContextBpmData.Number01 = JobOper_xRow.RunQty;
       callContextBpmData.Number02 = JobOper_xRow.QtyCompleted;
       callContextBpmData.Number03 = Math.Round((JobOper_xRow.RunQty) - (JobOper_xRow.QtyCompleted), 2);  
     }  

```

The rest of the BPM uses callContextBpmData.Number03

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [January 22, 2019, 2:20pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/2 "2019-01-22T14:20:53Z")

</div>

That error isn’t coming from a BPM its coming from the validateSerial method in the Business Object.

---

<div class="post-metadata">

**Author:** ![Valentina](https://www.epiusers.help/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@Valentina](https://www.epiusers.help/u/Valentina)\
**Post date:** [January 22, 2019, 2:22pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/3 "2019-01-22T14:22:57Z")

</div>

Yes, but when the BPM is not enabled the issue is not there (and EpicCare cannot help with BPM issues)

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [January 22, 2019, 2:26pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/4 "2019-01-22T14:26:09Z")

</div>

Is this the whole BPM? Or is there more to it, what you showed doesn’t do anything… that could remotely affect … well anything.

---

<div class="post-metadata">

**Author:** ![Valentina](https://www.epiusers.help/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@Valentina](https://www.epiusers.help/u/Valentina)\
**Post date:** [January 22, 2019, 2:43pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/5 "2019-01-22T14:43:01Z")

</div>

Yes, of course. That was just the custom code that is used to define the remaining quantity.  
The BPM is on the Labor Update

 ![image](https://epiusers.help/uploads/default/original/2X/f/fc9451d98928aa9679ac31e219f756046797b029.png)  
Condition 2: The ttLaborDtl.LaborType field of the changed row is not equal to “I”  
Condition 1: The ttLaborDtl.LaborQty field of the changed row is more than the callContextBpmData.Number03  
Condition 3: the method is called by Manager  
Show message in case the user is allowed but warned  
Raise Exeption 1 if the user is not allowed

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [January 22, 2019, 2:44pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/6 "2019-01-22T14:44:45Z")

</div>

yeah again that custom code isn’t doing anything that would cause an error. Do me a favor and comment out all the code and just put this there

```cs
Ice.Diagnostics.Log.WriteEntry("Test");

```

Do you still see an error?

---

<div class="post-metadata">

**Author:** ![Valentina](https://www.epiusers.help/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@Valentina](https://www.epiusers.help/u/Valentina)\
**Post date:** [January 22, 2019, 2:55pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/7 "2019-01-22T14:55:56Z")

</div>

Still the same error

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [January 22, 2019, 2:59pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/8 "2019-01-22T14:59:31Z")

</div>

ok so that tells you the issue is not the BPM. There’s no code there that could affect it. I’m guessing you are having some functional or setup issue with your serial numbers or serial tracked parts.

---

<div class="post-metadata">

**Author:** ![Valentina](https://www.epiusers.help/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@Valentina](https://www.epiusers.help/u/Valentina)\
**Post date:** [January 22, 2019, 3:08pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/9 "2019-01-22T15:08:26Z")

</div>

Sorry, I have tried again with the test code and it gave the correct warning message.  
So it seems the issue is still in the code.

---

<div class="post-metadata">

**Author:** ![knash](https://www.epiusers.help/user_avatar/www.epiusers.help/knash/32/74179_2.png) [@knash](https://www.epiusers.help/u/knash)\
**Post date:** [September 23, 2019, 9:12pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/10 "2019-09-23T21:12:10Z")

</div>

We have had the same issue here. We changed Conditions to be updated row vs changed row.

Problem went away.

---

<div class="post-metadata">

**Author:** ![gary.kite](https://www.epiusers.help/letter_avatar_proxy/v4/letter/g/9dc877/32.png) [@gary.kite](https://www.epiusers.help/u/gary.kite)\
**Post date:** [November 4, 2019, 4:09pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/11 "2019-11-04T16:09:38Z")

</div>

Hi

Thanks for this, I have just changed our BPM and it fixed the problem

---

<div class="post-metadata">

**Author:** ![Doug.C](https://www.epiusers.help/user_avatar/www.epiusers.help/doug.c/32/26714_2.png) [@Doug.C](https://www.epiusers.help/u/Doug.C)\
**Post date:** [March 22, 2021, 6:22pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/12 "2021-03-22T18:22:30Z")

</div>

I just ran into this problem and had to write a code block to do my condition statement. Nothing I tried in the condition block would get rid of the “More than one entry…” error.

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [March 22, 2021, 6:58pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/13 "2021-03-22T18:58:56Z")

</div>

Yeah there’s no way around this in a bpm

---

<div class="post-metadata">

**Author:** ![Doug.C](https://www.epiusers.help/user_avatar/www.epiusers.help/doug.c/32/26714_2.png) [@Doug.C](https://www.epiusers.help/u/Doug.C)\
**Post date:** [March 22, 2021, 7:03pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/14 "2021-03-22T19:03:41Z")

</div>

This is the same issue as it turns out:

> [@First receipt record in BPM is consumed?](https://www.epiusers.help/t/first-receipt-record-in-bpm-is-consumed/69010/5):
>
> Another wrinkle (support sent me to this site for help rofl) I moved the Pre-Processing BPM to PreUpdate, since this is the first step in the tracing. When I do everything correctly (meaning the BPM fires, but doesn’t stop) I get the following weirdness: I enter the 4 serial numbers: I save the receipt: [image] Here is what the serial number selection looks like now: I’m just unsure if I should call this an Epicor bug? They seem to be telling me it’s outsi…

I wrote my own code block in there just now and the problem went away. I guess I could look at the base code to see what they are doing, but for now I’m ok knowing there is a workaround.

---

<div class="post-metadata">

**Author:** ![Neil\_Jones](https://www.epiusers.help/user_avatar/www.epiusers.help/neil_jones/32/20002_2.png) [@Neil\_Jones](https://www.epiusers.help/u/Neil_Jones)\
**Post date:** [November 22, 2021, 11:59am UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/15 "2021-11-22T11:59:36Z")

</div>

Just found the same issue, would have taken ages to found this problem without this thread. Like Jose says the error doesn’t make sense but the widget certainly appears to be the cause.

---

<div class="post-metadata">

**Author:** ![tgwinn](https://www.epiusers.help/user_avatar/www.epiusers.help/tgwinn/32/100841_2.png) [@tgwinn](https://www.epiusers.help/u/tgwinn)\
**Post date:** [January 30, 2023, 6:32pm UTC](https://www.epiusers.help/t/bpm-is-interfering-with-serial-numbers/51680/16 "2023-01-30T18:32:39Z")

</div>

Sorry to necro this, but I thought this was useful to mention:

In Kinetic 2022 I had a similar error condition, on the same Labor.Update BO. In my case the error did not occur on our PILOT system, but did on the LIVE system. The difference was that the BPM on LIVE had a condition entry before the custom code block, just like ‘Condition 2’ in the diagram, whereas on PILOT this condition did not exist.

Resolution was to delete the ‘Condition 2’ block, and add its condition criteria as another line in the ‘Condition 1’ block (i.e., after the custom code block). I did not need to alter ‘changed row’ to ‘updated row’ on any of the condition criteria.
