Task Agent - 15 minute interval schedule, but only during business hours

Let’s say I want to put a task on a 15 minute schedule, but make it stop between the hours of 8pm-6am.

I could be missing something, but it doesn’t look like Epicor has that feature. My only thought is to create 56 individual “daily” schedules (if my math is right), but that seems ridiculous. Can anyone think of a better way?

The only way is to create a BPM to change the next firing time to be the next day at business start after you pass the end of business day.

2 Likes

Yes, I have a better way… but I can’t talk about it yet. :wink:
Are you coming to insights?

3 Likes

This sounds interesting :slight_smile:

Yes, I will be there… Is this a session I should keep an eye out for?

Might try @Doug.C 's BPM in the meantime.

I’m going to shadow you until Tim tells you his secret…

I hope it’s a revamping of the system agent/monitor…

2 Likes

It would be so great if the presenter names were listed in the agenda! Unfortunately we have to guess which sessions will contain all of Tim’s secrets.

2 Likes

What is the task you are wanting to run? Do you have an example?

If you schedule a function, you can do a time check at the beginning of the function, and don’t execute if time is between x times. Just a thought on a hack.

3 Likes

I was thinking of something along those lines. Windows Task Scheduler/PowerShell to execute a BAQ via REST(don’t think you can do functions through rest yet?). But also don’t know if the bpms you can write inside of them get called on REST execution. A lot of unknowns with this solutions, and a bigger hack.

1 Like

Depending on the version, you absolutely can.

There is also a function scheduler right in Epicor now.

image

2 Likes

Thanks for the tips all. Ultimately the business need probably isn’t worth writing code in my case, but I appreciate the suggestions.

The backstory is this: customer has Generate PO Suggestions running every 15 minutes (that’s what they want, not something I suggested), and there have been multiple times when the db server is rebooted for patching while the task is running. Then the task gets stuck as Active in the System Monitor, which causes a “similar process is already running” error when it tries to run again, so their Purchasing is largely dead in the water until I can get in there and backend update the systask and syskilltask tables (which seems to be the only thing that works).

My scenario might be more of an X-Y problem with regards to this thread’s topic, but I think my point still stands that Epicor really ought to have a feature that lets you set a “run between the hours of” schedule.

Running Generate PO Suggestions every 15 minutes seems highly unusual. That means that the buyers may not look at the PO Suggestions every 15 minutes. I HAVE seen companies run the generate during a mid day break (at noon), but that is normally scheduled specifically for that window while the buyers are at lunch.
What is changing so fast that makes them believe they need to generate suggestions so often?

I don’t know their purchasing processes very well, but I think it has to do with BTOs. A BTO sales order is entered and they want Generate Suggestions to get it on Purchasing’s radar asap. I’m sure there’s better approaches but I didn’t get into it with them really since this came to me as more of an IT problem. Again, X-Y problem for sure, but sometimes it’s a tigh-rope deciding when to push back on something vs go with the flow.

At my last company we did it for this reason. We had a lot of BTO and parts needing to be ordered for custom jobs. If it didn’t run every 15 minutes (net) then I’d hear about it.

Hmmm… wondering if the BTO argument (which is TOTALLY valid) would be better served with some form of an Epicor FUNCTION that could be triggered by a BPM (from Sales and from Job)… have the Function automatically create the PO Suggestion. It might take some magic in the function, but it is only one record added to a table each time a Sales order is scheduled, or a Job is Released.

2 Likes

Agree… this falls into the XY Problem category of questions!

@timshuwy and @TomAlexander . Thanks to everyone for assisting. Tom is helping us out with this issue and I am curious to the resources used by Generate PO suggestions. CPU, RAM, drive space are easy to monitor and don’t seem to be an issue. What I can’t see easily, and I am referring to historically, is the number of tables that get SQL locks while this process runs. We are receiving many non quantitative complaints that users say Epicor is slow. Tom did a great job upgrading and fixing slow code. Could this process be a source of some of the slowness?

And yes, we are starting a more quantitative approach as a mini project to look at all complaints. I am hoping to address the low hanging fruit here.

1 Like

PO Suggestions does scroll through all parts to look for demands. If you are running it in “net change” mode, then it may be faster than a full regen because it only looks at parts that have been flagged for a change since the last run… but I have never tested Net Change to see if it works for BTO.But any process that makes as many changes as Generate Suggestions (just like MRP) will slow down the system because it needs to modify multiple tables (PartPlant, POSug, PartDtl, JobMtl, OrderRel) and reads many more tables (JobHead, OrderHed, OrderDtl, VendPrice, etc, etc).

1 Like

Thank you Tim!

This worked for us under net change.