- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2023 08:03 PM
@cdavis22 I got you. Try this code for one last time.
I missed to notice the or condition in checking for week number. Try this updated code once.
var answer = false;
var s = new GlideSchedule("e939ddfcdb2c98501317f27139961981");
var w = new GlideSchedule("55ebbbf15f002000b12e3572f2b47714");
var gdt = new GlideDateTime();
if(gdt.getDayOfWeekLocal() >= 1 && gdt.getDayOfWeekLocal() <= 5){
if(s.isInSchedule(gdt) && w.isInSchedule(gdt)){
answer = true;
}
}
answer;
This code checks, if the day is in between Monday to Friday (including) (first if condition) and checks if the day is also a working day in both the schedules (second if block). If both scenarios matches answer is set to true which means the job should run, otherwise it will be false as it is initialized and returns the answer for condition to validate.
Anvesh