GetNewLaborDtlWithHdr Question

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…:fearful: Better get installing.

Happy to share my crusty workflow if anyone has the time and/or inclination to do a peer review.

Update. Posting for posterity, just in case someone else comes across this post.

After breaking things down into smaller parts and trying it out in E10, It turns out I was not loading the parameters into the GetNewLaborDtlWithHdr correctly giving me this additional 0 LaborDtlSeq value LaborDtl node in the xml.

Once that was resolved I had to sort through the submit process and the update of my source data table with the related LaborHedSeq and LaborDtlSeq information. It is all working now whew :sweat:.

So the takeaway from this ESC fans and newbies. Don’t do too much too quickly in a workflow. Break it down to little chunks and then stick it all together.

On quirky thing I did see was that using GetNewLaborDtlWithHdr to create Labor records, the LaborDtlSeq value skips one number from record to record. It does it through the GUI as well so it not my workflow. This also occurs in E10. I might have found my first undocumented feature! Strangely it only happens when you have the detail detail tab selected and click on new detail. If you have the list open and click it increments correctly

I was going to use TaskManager, but have realized that for end users it is pretty clunky and I am going to abandon the use of it for several dashboards which the users will be able to get information from with regards to how the time records are being processed.

So just to reiterate, break it down into small chunks and go from there.
.

3 Likes

Now in the light of day I try to replicate and I can’t make the records skip… Go figure :fearful: