- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 09:34 AM
We need to trigger notification 5 business days before the date selected in the date catalog variable (new hire date) and it should not trigger on weekends
Solved! Go to Solution.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 01:02 AM
Hi Krishna
1. create an event on RITM table
notify.user
2. Create a notificaton and listen to your event under whne to send
3. Then write a after insert/update Br on RITM table with
Fitler conditions:
selected date changes AND
selected date is NOT empty
script
var gdt = new GlideDateTime();
gdt.setDisplayValue(current.selected_date);//put right field name
gdt.addDays(-5); //deduct 5 days form the selected date
//put yoru scheduled sys_id here
var schedule = new GlideSchedule('08fcd0830a0a0b2600079f56b1adb9ae');
while(true) {
if(schedule.isInSchedule(gdt)) {
break;
} else {
gdt.addDays(-1);
}
}
gs.eventQueueScheduled('notify.user',current,'','',gdt);
Mark the comment as a correct answer and also helpful if it helps to solve the problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 12:29 AM
Hi
So if you have selcted the date as Thursday 5 days before that date will be Sudnay (if thursday has to be considered) or Saturday (if Thursday is not considered).
So should email will go on weekend. So if not weekend, shoudl it go on Friday or Monday?
Also, do you have a schedule created for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 12:48 AM
Hi Asifnoor,
if selected date day is Thursday then as per 5 business days the email should go on Friday. (5 + 2 weekends).
Email should not be triggered on weekends. basically we need to removed weekends.
Yes we have a schedule which is Monday-Friday(8-5).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 01:02 AM
Hi Krishna
1. create an event on RITM table
notify.user
2. Create a notificaton and listen to your event under whne to send
3. Then write a after insert/update Br on RITM table with
Fitler conditions:
selected date changes AND
selected date is NOT empty
script
var gdt = new GlideDateTime();
gdt.setDisplayValue(current.selected_date);//put right field name
gdt.addDays(-5); //deduct 5 days form the selected date
//put yoru scheduled sys_id here
var schedule = new GlideSchedule('08fcd0830a0a0b2600079f56b1adb9ae');
while(true) {
if(schedule.isInSchedule(gdt)) {
break;
} else {
gdt.addDays(-1);
}
}
gs.eventQueueScheduled('notify.user',current,'','',gdt);
Mark the comment as a correct answer and also helpful if it helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 01:50 AM
Thank you Asifnoor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 05:16 AM
Hi Asifnoor,
I got a similar requirement in my case i need to calculate a (opened at) field. like ‘Opened’ date + 8 business days.
Need to trgger a notification when opened date field value is 8 days and need exclude the weekends.
Thanks,