End Labor Activity with Coparts

Has anyone seen this error or understand what it means?

“ReasonPhrase”: “REST API Exception”,
“ErrorMessage”: “The total co-parts production quantity and labor quantity do not balance.”

Trying to this PATCH REST endpoint on our test database: “https://our-server-address/E10Train/api/v1/Erp.BO.LaborSvc/LaborDtls(‘SD’,128320,1470368)

With a simple payload like this:

{
    "Company": "SD",
    "EmployeeNum": "1234",
    "SubmittedBy": "smason",
    "LaborHedSeq": 128320,
    "LaborDtlSeq": 1470368,
    "SysRowID": "2F19262E-F9EF-4703-9FB7-F5FC081C8483",
    "LaborType": "P",
    "LaborTypePseudo": "P",
    "LaborCollection": true,
    "JobNum": "653781",
    "AssemblySeq": 0,
    "OprSeq": 10,
    "ResourceGrpID": "",
    "OpCode": "HVAC-R",
    "OpComplete": false,
    "JCDept": "306",
    "ActiveTrans": false,
    "ExpenseCode": "NONPROD",
    "ClockInDate": "2025-03-07",
    "ClockinTime": "14.27",
    "ClockOutTime": "15.86667",
    "ClockOutDateTime_c": "2025-03-07T15:52:06.000Z",
    "ClockOutDate_c": "2025-03-07",
    "LaborQty": "2.00",
    "LaborHrs": "1.43",
    "LaborRate": ".000000",
    "BurdenHrs": "1.41667",
    "BurdenRate": "50.000000",
    "OutputBin": " AWIP",
    "OutputWarehouse": "MAIN",
    "IndirectCode": "",
    "RowMod": "U",
    "TimeStatus": "E",
    "ApprovedDate": "2025-03-07"
}

I’m not sure what it means by Labor Qty and Copart Qty. Anyone had similar error with coparts before?

Is the job set up as a Co-Part job? If it is (and I’m guessing it is), then you need to report the number of each part that was produced. There is a separate tab/card for entering co-parts in MES/Labor Entry. You may want to look at that to see what fields are used in the table for co-parts and include those in your payload.

So I think I solved, it. In order to end activity with co-parts I discovered through testing and tracing that Epicor requires the following (high level) sequence to work. These correspond to different payloads:

  1. End the labor activity but set its status as ‘E’
  2. Call another REST to UpdateExt and set the labor details and labor part info to update the co-part quantities.
  3. Call the end labor activity again but this time set it to ‘A’

Well, in my first payload (1) I was setting the Labor Qty. Then call number (2) was erroring probably because I had already set the labor qty in the first call.

Instead what I did was if it was co-part job, I removed the Labor Qty from my payload. That let call (1) work and then call (2) went through without a problem. I left the Labor Qty off for call (3) as well since it was already set from (2).

1 Like