LaborHed and LaborDtl

I’m trying to create labor detail records with REST. But I would like to know the relationship between LaborHed and LaborDtl.

I can make a new LaborHed record with POSTMAN. Then I take note of the LaborHedSeq number that was created. I try to feed that into a different REST call to make a new LaborDtl record. Instead of using the supplied LaborHedSeq, the BO makes a new LaborHed record instead of using the one I supplied and then sets that as the newly created LaborDtl records’ LaborHedSeq to the new one it made.

Are we allowed to add many labor detail records to a laborhed record? Kind of like the sales order hed can have many order detail records? If so, is there special field in the LaborDtl rest call that needs to be set besides LaborHedSeq? Because Epicor is not honoring the value I enter in that field.

Which calls are you using? There may be another one that does what you’re after.

Using the Swagger Documentation from here: https://our-server/E10Live/api/swagger/v1/odata/Erp.BO.LaborSvc

LaborHed create: [POST] https://our-server/E10Live/api/v1/Erp.BO.LaborSvc/Labors

LaborDtl create: [POST] https://our-server/E10Live/api/v1/Erp.BO.LaborSvc/LaborDtls

Gotcha. The laborHed to laborDtl relationship is one to many, so there should be some way to do it. You may need to do a PATCH with LaborSvc/Labors rather than the POST on LaborSvc/LaborDtls to add to your previously created LaborHed. One of the custom methods may be easier to work with too. You could try the LaborSvc/StartActivity, which would mimic how MES does it.

If I remember correctly the LaborHed record is created by EmpBasic.ClockIn().

2 Likes

After post to ClockIn ,we can get LaborHedSeq from LaborHed.
Thanks for your information.