to send notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-05-2023 09:18 AM
i have a table in which i have date field now i want to send notification before 30 days of the selected date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-05-2023 09:38 AM - edited ā11-05-2023 09:45 AM
Hi @abhi159,
Create a schedule job that runs on daily and trigger notification from schedule job and add event in notification and schedule job.
Script:
var today = new GlideDateTime();
today.setDisplayValue(new GlideDate());
var notificationDate = new GlideDateTime(today);
notificationDate.addDays(30);
var myTable = new GlideRecord('your_customtable_name');
myTable.addQuery('date_field', '>', today);
myTable.addQuery('date_field', '<=', notificationDate);
myTable.query();
while (myTable.next()) {
gs.eventQueue(āeventnameā,current,parm1,parm2);
}
Please mark it as solution proposed and helpful if its serves your purpose.
Thanks,
Anand