We are on 9.05.701, So I not sure if this is particular issue with the Labor.GetNewLaborDtlWithHdr method for this version or not, but it behaves differently to GetNewLaborDtlWithNoHdr. Based on traces and testing I have been doing, I originally created a workflow that just used GetNewLaborDtlWithNoHdr, as a result the data processed correctly, but we ended up with duplicate time and attendance records (LaborHed) for the same day. From our perspective this was not very desirable, and really wanted one time and attendance record for each day and multiple labordtl records under that. Redoing my trace I noticed that clicking on new time detail for the second time on the same day, this fires the GetNewLaborDtlWithHdr method. Thinking that this was going to be an easy fix ,add a choice and direct the workflow to one method or the other. On the outset it all looks great, but what I discovered is that the resulting workflow creates duplicate entries for all records that run through the GetNewLaborDtlWithHdr method.
Looking at the activity I get when I look at the Labor.Epicor.Mfg.BO.Labor.GetNewLaborDtlWithHdr
What I find interesting is the fact that I have two LaborDtl Entries. One has a labordtlseq of 0. The workflow goes further on to fire the update_ext and I recall from what I picked up along the way is that performing an update_Ext with a keyfield of 0 it will automatically generate the record. I suspect that this is what is happening.
The Labor.Epicor.Mfg.BO.Labor.GetNewLaborDtlWithNoHdr only shows the full LaborHed and one LaborDtl entity in Xml.
My question is how do I prevent this from occurring, or is this a known issue with that method in this version?
Next step is to test this in E10… Better get installing.
Happy to share my crusty workflow if anyone has the time and/or inclination to do a peer review.