Submit Time in updatable BAQ

I have created an updateable BAQ that will be invoked via REST to create Time Entries. The process functions, but we want to properly Submit the entry after it’s created. I tried simply setting the TimeStatus to ‘S’, which does mark it as Submitted, but it doesn’t show up in Time Approval. It also doesn’t show who submitted it then (the field is read only). If I go into Time Entry, recall, then submit it, it puts the name in Submitted by and shows who should be approving it in Pending Approvals. I figured I should probably invoke the Labor.Submit method, but I don’t know how to get the data from ttResults into an Erp.Tablesets.LaborTableset object for the Submit. Is that the way to go about it or is there an easier way? We don’t want auto-submit across the board, only the entries being created through the BAQ.

Maybe a BPM on Labor.UpdateExt that then calls Labor.GetByID (to get your LaborTableset) and then calls Labor.Submit?

You can manually convert the Baq dataset into a LaborTableset object, but I wouldn’t bother.

Thanks for the idea :slight_smile: Now to get it to work.
I first tried it within the BAQ and I couldn’t get it to do anything. I then tried it in UpdateExt and it still doesn’t do anything. What am I doing wrong?



Are you wanting to be able to do many entries at once?

I’ve never tried this with a uBAQ, but I did it with an Epicor Function – but only one at a time.

It requires a lot of widgets…

No, I really just want to do one at a time. There’s only one LaborDtl record involved. In general, we don’t care about LaborHed at all, it’s only there to serve up the LaborDtl record for us. No information from LaborHed even shows on our screen. (heavily customized).

Right, we don’t use LaborHed either.

So if you are doing REST and it’s only one per, I’d think you’d be better off with the Function way.

I’ve done many uBAQs - even one for REST - but my understanding is that labor is just not as simple as adding a row. I know, the DMT is simple (TE Labor Detail No Header). But I think it belies a lot of processes in the background. Ultimately the BPM inside the uBAQ is going to look the same as an EFx would anyway.

Also, you can trace a DMT upload - maybe there’s a simpler way than what I’ve done.

And there are smarter people than me here that might disagree with me.

The BAQ is working to create the entry properly. It just won’t submit it correctly. We did originally have it set TimeStatus=“S”, which then made it display submitted on the screen, but the submitted by was blank and it doesn’t show up for any approver. We are creating a LaborHed and a LaborDtl record for each Time Entry created. (yes, there’s a lot of required fields, but I found them :slight_smile: ) The part I can’t figure out is what makes it visible to the approver.

I think submit is a method that you call on this object and not just setting the field. I believe it has to do with approval tasks, even if you are not using them.

NVM. I missed the graphics in the post above…

Thanks to Jacob_Leggatt for posting the code he was having some trouble with, I saw that he called the ValidateChargeRateForTimeType method after setting RowMod to “U”. Once I added code (inside the BAQ, where I wanted it to be) to GetByID, set the RowMod to “U”, then ValidateChargeRateForTimeType before calling SubmitTime, it worked. No idea of WHY that was needed, but if it works, it works.