wanted to restrict the change implementation in the business hours

rajasekahr
Tera Guru

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.

1 REPLY 1

rajasekahr
Tera Guru

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


}