Last Day of Month System Agent?

Does anyone have a nice way to have a schedule that runs on the last day of any given month?

We have the same need for this as well, and we are not using the user process scheduler.

I designated a ud table to be used for automated/scheduled routines. Each routine is initiated via a REST call to change checkbox01 from false to true , which then initiates bpm’s on UD02.Update according to their key 1 execution name.

I’ve then scheduled a powershell script to hit our api end point on a schedule.

or this?

image

1 Like

Not following on the UD table/rest design to get “last day of month” as a schedule. Also the ss shows last friday :wink: if It had an option for Last Day of Month, it would be fantastic

Last day is tricky. You could probably write a little utility that figures it out and update the system agent schedule number in question with the appropriate value, then run that little utility on a schedule option that is more easily available.

Why not simply run the process the first minute of the first day of each month. This way, you are essentially running “in between” months.

2 Likes

That is pretty clever, but unfortunately it needs to run the morning of the last day of the month. The other part I need to figure out is how to pass different execution parameters like date ranges in. Working on replacing an existing Ssrs report and subscriptions with a BAQ…

I have to collect a bunch of data on the last day of the fiscal period. I just fire the process daily and check the fiscal calendar if today is the day and exit otherwise.

1 Like

Oh I missed your question @Aaron_Moreng

The reason I said powershell is that you can kick off a rest call from it and have PS scheduled to run like this:

2 Likes

I really need to get more into powershell. Ok so we can control the schedule from ps, can i also control the parameters of the baq? And also who to send it to? If so, that’s probably my solution. I want to have the one baq as a dashboard and also as the data source of the report

There are 2 different routes you can take that come to mind. 1 is you utilize a rest call to simply change a checkbox on a UD table, when that checkbox is changed fire off a BPM on UD.Update() that uses whatever you need. The 2nd option is to utilize the BAQ rest service directly and do all of the logic in your rest call. I believe you can add parameters if you utilize the BAQ rest service but I could be wrong.

You are correct. You can add parameters in the REST call.

Here’s a link to a post about adjusting “next runtime” when Daylight Saving Time kicks in.

Ignore the DST aspect, and just consider it for automatically adjusting the NextRunTime(and date) of your “Last of Month” schedule.

Edit

The tl;dr version …

Make an In-Tran Data Directive on SysAgentSchedule with conditions of NextRunOn changing, AND the name or ID of the “LOM” schedule. When this fires, calculate a new NextRunOn for the last day of the next month.

@Aaron_Moreng

It appears that there’s a built-in “last day of month”.

Setting a schedule for: Monthly, Every 31 will do what you want.

Here’s the schedule, with next run of 5/12/19 at 4:30 PM (a few minutes after I created it)

image

And here it is after it fires.

image

Note that it set it to the last day of the following month. In this case June 30 (not June 31st).

And it maintained the time portion. So if you want it to run at 6:00 AM on the last day of the month:

  1. Schedule Type: Monthly
  2. Every: 31
  3. Set the next run to 5/31/2019 6:00 AM

It should run at 6:00 AM on 5/31, then set its Next Run to 6:00 AM on 6/30.

11 Likes

If the dates are fairly constant (like last 3 months), you could add a Date option to the BAQ Report then use the dynamic settings when scheduling it.

As for sending it to people, either use Break/Routing (if you have the advanced printing), or use the email option when scheduling the report.

1 Like

Alright man this is exactly what I was hoping for!! I’ll give it a shot. Hopefully I’ll be able to do it but I’ll reply with the results either way