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