- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 01:48 PM
Thanks for the reply! This is the first time ive used schedules... so I may be doing something wrong. Please see what I have set-up below. No matter what time I set the schedule to be free the message after hours still shows.
Script within record producer:
var schedRec = new GlideRecord('cmn_schedule');
schedRec.get('name','Research Request');
var sched = new GlideSchedule(schedRec.sys_id);
var schedTime = new GlideDateTime(gs.nowDateTime());
gs.log('Time 1: ' + schedTime);
if (sched.isInSchedule(schedTime, 'US/Eastern')) {
gs.addInfoMessage("in hours ");
}
else {
gs.addInfoMessage("after hours"); 20.}
------------------------
Screen shot of schedule: