Reporting Schedules - Weekdays only

narelle_s
Kilo Explorer

Hi,

I've scoured the forum and the Wiki for answers to this, but cannot find an answer.

If a user only wants to schedule report for Weekdays, how do I do it? I can see there is a suggested script code for scheduling a script to exclude Saturday & Sunday, but how can I apply that to a scheduled report?

There is no Business Day type Calendar or Schedule, in the report options for a scheduled report, so other than creating 5 schedules, one for each day of the week, what's the answer?

Thanks
narelle

10 REPLIES 10

Mark Stanger
Giga Sage

Add a new checkbox to the scheduled report form called 'Weekdays'. When a user checks this box, populate the 'Condition' box with the script shown here...
http://www.servicenowguru.com/system-definition/weekdaysonly-scheduled-job/

You'll want to add some client scripts and UI policies to make this work correctly.

1) A UI policy that displays and hides the 'Weekdays' checkbox when the 'Daily' Run value is changed. It should also set the 'Weekdays' checkbox to false if the Run value is not 'Daily'.
2) A client script that sets the 'Condition' field with the script and makes it readonly when the 'Weekdays' checkbox is checked. It should also do the opposite when the 'Weekdays' checkbox is set to false.


Bob
Giga Contributor

Mark, thank you very much for doing the write-up on this. I followed your Requirements and made an enhancement to our ServiceNow instance that I think our users will find value.


I expanded it to work with 'Daily' and 'Periodically' for the Run values as this is useful for running reports multiple times a day, but just not on the weekends.



Much Thanks,


JBest
Kilo Explorer

Would you consider this a major change? From what I am seeing there is not much to it. It appears that this could be done without impact, especially if it were tested first on a non-production instance.


Yeah, I'd say this is a fairly insignificant modification. It's the scheduled job itself that is more risky but you have to deal with that whether or not you apply this solution.