wanted to restrict the change implementation in the business hours
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2023 11:22 PM
I have one requirement on the change module ,if any body entered the "planned start date" falls in business hours that record save should should not happened. Please guide me if anybody come across this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2023 12:00 AM
i have tried already checked with this code but this not working
var now = new GlideDateTime();
var scheduleID = "sys_id of the schedule";
var userTZ = gs.getUser().getTZ();
var schedule = new GlideSchedule(scheduleID);
schedule.setTimeZone(userTZ);
if (schedule.isInSchedule(now)) {
gs.addInfoMessage('Please note that change planned start date should not be in business hours');
current.setAbortAction(true);
} else {
gs.addInfoMessage('testing');
// Outside of schedule
}