Schedule Job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 03:39 AM
I need send a email notification regarding work anniversary at a time 100 employee using schedule job ?
Any idea how to build the above task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 10:37 PM
Hi @P1234 ,
Could you be more specific on what task are you talking about or can you please attach a screenshot of it?
Thanks,
Yashraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 10:58 PM
Hi Yashraj,
send a notification to 100 users at a time regarding work anniversary using scheduled job code.
var user = new GlideRecord('sys_user');
user.addEncodedQuery('work_start_dateRELATIVEEE@today');
user.setLimit(100);
user.query();
while (user.next()) {
// Send notification logic
var notification = new GlideRecord('sys_notification');
notification.initialize();
notification.to = user.email;
notification.subject = 'Work Anniversary';
notification.body = 'Congratulations on your work anniversary!';
notification.insert();
}
But code is not working any idea please send me the exact code.