Execute code on a BAQ

Hey

Im trying to fire some code on a scheduled BAQ. Currently i have a simple send email on a GetList method to the Labor table and that doesnt fire.

My BAQ is on the LaborHed table ON EmpBasic for the empID.

I cannot find a method to fire the code. 3 things need to happen

  1. BAQ runs to get the punch in / punch out rows
  2. code runs to send the BAQ results to the 3rd party Rest API
  3. this happens on a daily schedule.

I can also call the BAQ within the code so its not restricted to the BAQ firing first

Question: What do i need to make all of this happen ?

I guess the real question is, how do i fire the code? what method / process do i need to use?

Thanks

  1. That’s standard, design your BAQ to spec.

  2. Add a post-processing method on GetList, you can access the result rows there.

  3. I’m so spoiled by ā€œSchedule Epicor Functionsā€ in the later versions than you that I can’t remember. Let me see if I can find an answer. I think maybe you could schedule a BAQ report? Dunno lol.

1 Like

I answered that one in your other thread:

Sorry if I confused you when I asked you to make a new thread.
They ended up mostly the same.

I meant one for scheduling the code, and I thought you needed help with the code in the other.

No matter. We’ll figure it out lol. :rofl:

Hey Kevin

I very much appreciate your reply and the time taken to test and lay it all out. I did consider yesterday using a BAQ Report but then quickly ditched the idea, probably too quickly.

I also though about making my BAQ updatable yesterday but seeing as the data wasnt getting ā€˜updated’, i figured it might be be what i needed but it makes sense looking at it again.

I made my BAQ updateable and created a post process on the GetList and am now able to run code. I dont think i need to do the BAQ Report, i can run a BAQ export on the BAQ and schedule that. I have this on some other BAQs but they actually need to update the BAQ.

There is a little update in the code but its nothing major and i’ll report back on my final results.

Thanks again for all of your help and steering me in the right direction

Nacho

I thought that was removed in later versions.

Obviously not in yours, but is that correct guys?

But anything you can schedule should be fine.

I was going to say
ā€œYou can just use a Dynamic Report instead of a BAQ report. (i.e. create a RDD and add a BAQ to it, then create a new report style).ā€ but reread. You are sending to an external API.

In your circumstance I would be going with the UBAQ and sending to the REST API directly from there and use the Export BAQ Process. That way you would have a copy of what was sent to the REST API. I would go as far log it to a UD table.

@klincecum Yes it still exists 2024.1
image

1 Like

Answering my own question with a little egg on my face.

image

Still there today, and now I remember I have used it. :rofl:

Face Egg GIF by The nutrition guru

1 Like

Update on my progress:

Set up the Post Procerss GetList code in the BAQ, got it all working and i can post to UKG. I experienced some annoying Epicor issues, the main one being-

If i made an update to my custom library then uploaded that to the custom library folder, Epicor could see it, see the version of it but still persisted to remember the previous version. I have removed the reference & assembly, re-added them but still the same. I haver changed an args() parameter from DataTable to String. The Syntax was correct but it wouldnt let me save. In the end i updated my custom Library to a new name, new namespace and new class name then it worked so somewhere it remembered the old stuff…

Anyway, its all working now so thanks for all of your help :slight_smile:

2 Likes

I think an application pool recycle would resolve that, sounds like caching.

2 Likes