Need to send notification 5 business days before due date in ritm table

mounicareddy
Tera Contributor

I have a catalog item Need to send notification 5 business days  And 2 business days before due date in ritm table

 

due date is lessthan  5 business days ,2 business days no need send email notification please help on this thank you

 

1 REPLY 1

Namrata Ghorpad
Mega Sage

Hi @mounicareddy ,

1. create an event on RITM table

notify.user

2. Create a notificaton on RITM table and in when to send tab select event is fired and select event name.

3. Then write a after insert/update Br on RITM table with 

Fitler conditions:

due date is NOT empty

script

 

var gdt = new GlideDateTime();
gdt.setDisplayValue(current.due_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);

 

 

Please mark my answer as helpful/correct if it helps you.

Regards,

Namrata