- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 04:16 AM
employees should submit their time cards by the end of each week (Sunday) for approval. If the time card is not submitted by the due date, a notification should be sent to the employee and their manager as a reminder.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 04:24 AM
Hi @MK-p ,
You can follow below steps.
- Create one event based notification. check here how: https://servicenowwithrunjay.com/email-notification/
- create one schedule job and execute below script.
- run schedule jon on every monday so that missed timecard will be in target.
var timeCardGr = new GlideRecord('time_card');
timeCardGr.addQuery('state', 'Open');
timeCardGr.query();
while (timeCardGr.next()) {
var user = timeCardGr.getValue('user');
var manager = timeCardGr.getValue('manager');
// Send notification to user
gs.eventQueue('time_card.reminder', timeCardGr, user, manager );
}
Note: this solution is best for one time card per user per week, if you have multiple time card the glide record on timesheet table to sent notification.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 04:21 AM
What have you tried?
If you haven't tried anything... what components would you reach for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 04:24 AM
Hi @MK-p ,
You can follow below steps.
- Create one event based notification. check here how: https://servicenowwithrunjay.com/email-notification/
- create one schedule job and execute below script.
- run schedule jon on every monday so that missed timecard will be in target.
var timeCardGr = new GlideRecord('time_card');
timeCardGr.addQuery('state', 'Open');
timeCardGr.query();
while (timeCardGr.next()) {
var user = timeCardGr.getValue('user');
var manager = timeCardGr.getValue('manager');
// Send notification to user
gs.eventQueue('time_card.reminder', timeCardGr, user, manager );
}
Note: this solution is best for one time card per user per week, if you have multiple time card the glide record on timesheet table to sent notification.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------