Get the Newest LaborDtl for a JobNum using Epicor API

Is there a way to get the newest LaborDtl for a JobNum. I noticed that several entries have the same JobNum, probably from me starting and stopping jobs over and over for one employee. I would like only the newest entries and ignore the duplicates that are not relevant anymore.

I’m using /api/v2/odata/t300/Erp.BO.LaborSvc/GetByID and passing in laborHedSeq

Thanks.

john, what version are you on?

I’m using Epicor 10 and Api v2

Thanks

1 Like

Here’s an answer from the past posts you have had, maybe another BAQ is your best bet.

Yes and that was great advice for getting my BAQ to work. What I’m trying to do now is filter down the number of items coming back in LaborDtl to only show the most resent JobNum entries.

Why can’t you filter it in the BAQ?

How is the LaborDtl entry marked when a user ends activity but doesn’t mark it complete?

Complete = false and Active = false.

Do you have a test system John? Cause you can try clocking in and out of a job and querying the labor dtl table while you are clocked in and clocked out and when you complete a job or don’t complete a job and you’ll be able to answer questions like the one you just asked pretty easily.

If those are your conditions, a baq like this should do it:

select top (1)  
	[LaborDtl].[LaborDtlSeq] as [LaborDtl_LaborDtlSeq]
from Erp.LaborDtl as LaborDtl
where (LaborDtl.LaborHedSeq = @laborHedSeq  and LaborDtl.ActiveTrans = false  and LaborDtl.Complete = false)
order by LaborDtl.LaborDtlSeq Desc

Only issue with sorting by LaborDtlSeq is if we have to enter missed clocks in T&E. It could have a higher seq than “later” transactions.

I tend to use ClockOutMinute for closed labor details, personally.

2 Likes