Send notification with list of users who are not submitted their timecards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2024 06:36 AM
I would like to send a notification to all line managers every Monday morning, containing a list of users who have not submitted their timecards for the last week. This list should include all users who have pending or recalled timecards (meaning that they have created a timecard but not yet submitted it) as well as those who have not even created a timecard (meaning that no record is available). Can someone please help me with this. Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2024 10:13 AM
What is the timecard table name? Please share.
Regards,
Priyanka Jeganathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2024 09:13 PM
Thank you for replying to me, timecard table name: time_sheet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 05:59 AM
Hi @RAYAPPA Y
Please use the below email script in the email notification.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var count = 0;
var timesheet = new GlideRecord('time_sheeet');
timesheet.addEncodedQuery('query the record as per your requirement');
timesheet.query();
template.print('<style>table, th, td {border:1px solid black;}</style>');
template.print('<table>');
template.print('<tr><th>Sl.No</th><th>User Name</th>');
// table structure
while(timesheet.next())
{
count = count+1;
template.print('<tr><td>'+count+'</td><td>'+timesheet.field name which has user name+'</td></tr>');
}
template.print('</table>');
})(current, template, email, email_action, event);
Please let me know if this helped you to resolve your issue.
Thanks & Regards,
Anitha H V