How to schedule a scheduled job only on weekdays?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 05:00 AM
How to schedule a scheduled job only on weekdays?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 05:02 AM
Hi Swathi,
These below links will help you to schedule your schedule job only for weekdays:
Reporting Schedules - Weekdays only
Hope it helps!!
Regards,
Anjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 05:04 AM
check the run job daily and check the conditional check box
in the advanced script: try the below script
whenToRun();
function whenToRun(){
var day = new Date().getDay();
return (day == 1 || day == 2 || day == 3 ||day == 4 ||day == 5); // or return (day != 0 || day != 6 )
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 05:04 AM
Have it run every day at the same time. Within your script, you check for the day of the week. If it's not a weekday (2-6), you exit. You can get the day of week with the GlideDateTime() method, getDayOfWeekLocalTime();
var gdt = new GlideDateTime();
var dow = gdt.getDayOfWeekLocalTime();
if (dow < 6) {
// Do your weekday logic here
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 05:34 AM
Minor update to my condition statement. Per documentation:
The day of week value, in the user's time zone, from 1 to 7. Monday equals 1, Sunday equals 7.