Skip to Content
Product Information
Author's profile photo Neelesh Kamath

Timely Time Sheet Alerts for no records on previous working day

Overview

In most industries especially in health care, their employees are spread across different geographical locations and they need to meet some customer policies. Their important ask is Attendance marking in SF EC module. They would like to trigger a notification mail by the next day’s early hours if employees haven’t marked their attendance for the previous day.  And this is a recurring mechanism that needs to take place for employees every day. And further, we have these complications: Do employees have a full day absence or partial day absences in the previous working day? Is the previous day a planned working day as per the work schedule? What happens if an employee records a partial day absence? What happens if the employee records a partial working time?

Below is a solution that can be used to tackle such requirements and constellations.

Disclaimer: The below is one of the solutions. You can have multiple customizations and some other ways of doing this. Please evaluate according to your requirements

Design

Create a custom MDF that has the following fields

User -> External Code

Previous working day -> Date

Has Time Records or Not a Planned working Day-> Boolean Yes/No

The custom MDF will be used as a tracker object which basically tracks if the employee has recorded times if the previous day has planned working time as per the employee’s work schedule

Create the below on Save Rule

 

 

 

The on Save rule basically checks the following

  • If previous day has planned working time. If planned working time is zero (like weekends), it does not process the emails and the flag is stored as yes
  • If there is a vacation and recorded working time on previous working day. It checks for all combinations of partial day absences and partial day time recording etc. Based on the situation, we store the flag as yes/no.
  • The flag value would be then used to trigger alerts to employees/managers.

 

Please note, this is a sample rule and you can add any number of time types to the function Get Absences for period. Moreover, you could also use additional attendance time types for recording such as Overtime, Business Travel etc. This needs to be created as additional variables and included in these if clauses above. Just extend the pattern that I have used in above rule

 

Alert Rule

 

Create an Alert Rule like below

The Alert Rule has to be attached to Post Save hook of the Custom MDF

Integration Center

 

An integration Center Report is created with Starting entity as “USER” and our “Custom MDF” as the target entity.

Drag and drop the user ID from USER to External Code (User field) of Custom MDF.

Also, ensure that you use operation as Upsert Single/Multiple in IC

You can add filters for ex: to run this only for a subset of employees

I have added a filter to run this for only a particular LE

Schedule the IC , every morning after 12AM Server time

TESTING

 

Today is Oct 21st, 2021 and we need to check for Oct 20th 2021

Run the IC for the employees

MDF records should be created or updated like below

User 1 has recorded time on 20th Wed

No Email Received as the employee has times recorded on previous working day

User 2 has no time recorded on 20th

Email received

User 3 has a full day absence on 20th

No Email Received as employee was absent for whole day

User 4 has a partial day absence, but no time sheet recorded for the remaining time

Email Received as employee is expected to work for remaining time

User 5 has both partial absence and 4 hours of time recorded on 20th

 

No Email received as the employee has worked for some part of the day

 

Part 2- Notifications for Pending time sheet in previous weeks

A similar requirement to the above feature which is commonly asked by many customers is to send an alert to the employee if there is a pending timesheet in the previous week i.e employee has not submitted the timesheet for the previous week for approval.

 

I will basically highlight some design aspects here for you to work on.

Create a similar custom MDF which looks like below with external code as USER field

Create an integration center report with the below design

The starting entity should be the employee time sheet and the user field from the time sheet object should be mapped to the external code field of the custom MDF

Create the below filters

We need to check only those records which are in “PENDING” state and where the start date and end date lie in the previous week range.

Finally, if the timesheet week period is from Monday to Sunday, make sure you run this IC every week on Monday or Tuesday

Further, Create an alert and workflow mechanism to send out alerts just as described in the above sections.

 

TESTING

The user has not submitted the previous timesheet record from Nov 1 – 7

When we run the IC on Nov 8th (next week), an email is sent out to the user as an alert

Hope this mechanism helps in your implementation projects

Stay Safe & Healthy

Neelesh

Senior Product Specialist, Best Practices for SF

Successfactors Product Management

SAP Labs

Assigned Tags

      24 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Srinivasan Sundaram
      Srinivasan Sundaram

      Awesome Neelesh!! Wonderful Blog!! Timely information for my project - Thanks so much!!!

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Thanks, Srinivasan for the feedback. Hope this helps in your project

      Author's profile photo Veman Thanam
      Veman Thanam

      Hi Neelesh,

      Thank you very much for the blog and the details that you provided.

      Kindly can you just confirm if this rule can be used on our regular time sheet or this is on time tracking only.

       

      Author's profile photo Hiren Patel
      Hiren Patel

      Touche'

       

      Is there a process for late coming to be counted as half day?

      Author's profile photo Veman Thanam
      Veman Thanam

      Thank you Neelesh for this blog. It is very helpful.

      Kindly can you confirm if this can be used on Time sheet or this is specific to Time tracking process.

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Thanks for your feedback. Yes, I expect this to work for both since time tracking is just an extension of the timesheet.  But I have tested this for normal time sheet

      Author's profile photo Mohit Somani
      Mohit Somani

      Thanks Neelesh for the blog. Nice idea.I think many customers have similar requirement to send alerts and notifications for previous week timesheets which are not approved/submitted. We can use similar approach for that as well. Not sure if we have any standard solution for that.

       

      And for previous day notification, instead of custom mdf and integration center, could we use the same rule on save and post save of employee timesheet object or timesheet day object? Not sure just thinking out aloud.  🤔😄.  Timesheet validations are not recommended there, but I think still supported .Hoping to reduce custom mdf objects😉

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Thanks, Mohit for the feedback 🙂  Glad that you found it useful. Yes, you are right about exploring timesheet day object. Even I tried using this first to check If I can get desired results. The problem with this object is that this is transient and not stored in database. It gets filled at run time and hence we cannot write on post save rules for this. Regarding EmployeeTimeSheet object, the rules will get triggered only when the employee creates and saves a time sheet. But the rules will not be processed when an employee does not fill timesheet. In such a case, we cannot really track who did not fill it (although we can track who filled it). hence this approach of using custom MDF and IC where on the save event, we can do various lookups and use rule functions to check who does not have timesheet filled. I know this is an additional custom MDF but this gives you more flexibility to write complex rules and perform any combination of checks in the tracking MDF object

      Author's profile photo Mohit Somani
      Mohit Somani

      That’s true! Thanks for clarification!

      Author's profile photo Alexandra Dinca
      Alexandra Dinca

      Super useful notes, Neelesh! Many thanks for the insights!

      Do you know if we could raise alerts for obligatory rest periods (e.g. at least x uninterrupted hours of rest between work shifts or previous vs. current work day end/start times)?

      Example:

      we have a rest period between working shifts of 11 hours

      on Nov 1, employee starts shift work at 10:00 and ends work at 18:00.

      on Nov 2, employee starts shift work at 6:00 --> the system alerts the employee that they should have a minimum rest period between working times

      HR admins would be able to follow-up with the employee after n alerts raised.

       

      Thanks so much & Have a fantastic day! 🙂

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Thanks, Alexandra for the feedback. Regarding your requirement  , I have not tried this. Perhaps you need to look up employee time records for previous working day and previous working day -1 and then compare start times and end times and accordingly decide to trigger an alert. You can look at my blog on how to lookup employee time records in the rule

       

      Author's profile photo Alexandra Dinca
      Alexandra Dinca

      Many thanks, Neelesh!

      Author's profile photo Sayali Pawar
      Sayali Pawar

      Hello Neelesh,

      We followed blog successfully but still didn't received email notification for the same. can you please help with solution.

      Thanks & regards

      Sayali Pawar

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Hi

      Please troubleshoot using the following mechanisms

      1. Create the Custom MDF manually and set the flag to send notifications as Yes
      2. Attach a rule trace to the alert rule and see if the rule is triggered correctly along with workflow
      3. If the Alert workflow is triggered correctly, then check the email address for the receipents is maintained correctly or not. Also you can check pending alerts in "manage alerts and notifications" from admin center. If an entry exists in manage alerts and notifications, perhaps it could be an issue in sending emails from your instance and hence it is still stuck in the manage tool. You would need to follow up separately via a support ticket for email issues

      We have deployed this solution in our instances including other partner/customer instances and it works fine for us

      Author's profile photo Utkarsh Parikh
      Utkarsh Parikh

      Hi Nilesh,

      Very nice blog.

      Can you please help on how to get below requirments?

      Alerts and notification goes when a user time recording is less than half of the planning working time for previous day.

      My requirement is to send alert notification employee if their previous day time sheet is totally not filled or partially filled and with short hours as well.

      Can you pl ease support?

      Regards,

      Utkarsh

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Hi Utkarsh,

      Thanks

      Regarding your requirement all you have to do is following.

      In variable store the result of planned time previous day using rule function
      Say Var1 = Get Working Time In Hours () of previous working day

      Then do a lookup as I have described in the blog to get recorded time in previous working day and store in Var2

      If( var2 == 0 ) OR (var2 >0 AND Var2 < var1)
      (means employee has no recorded working time or has partial recorded time which is less than planned time stored in Var1)

       

      You can check my rules in the blog. I have used these rule functions

      Also put a rule trace and check your test cases. It should help you to test multiple test cases and trouble shoot

      Regards

      Neelesh

      Author's profile photo Utkarsh Parikh
      Utkarsh Parikh

      Thank you Neelesh for immediate support but unfortunately it is not working.

       

      I have created below 2 variables based on your advise:

      In your screenshot of Time Recording Variable I can see object "Time Off Request" which is not visible in my system so used "Absence Request". Pl advise.

       

      Regards,

      Utkarsh

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Please check the rule trace if the variables are returning a value..Also when you are looking up for EmployeeTime  or absence request, you would need to pass the time type which is attendance time type.. Can you paste the rule trace here of the rule? In My instance EmployeeTime has been labeled as Time off Request. In your instance it could be "Absence request"

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Also the VAR2 need not be 0..It could ne null if the previous day has no time records..So replace 0 with Null for Var 2 and check

       

      So if(VAR2==NULL) //No time recorded => updated custom MDF to send notification

      Else if (VAR2!=NULL and VAR2 < VAR 1 AND VAR2 >0) //Partial time recorded => Update custom MDF to send notification

      Please put rule trace and check values of variables and these conditions ..For testing , you can create the custom MDF manually from manage data for the user

      Author's profile photo Utkarsh Parikh
      Utkarsh Parikh

      Thanks a lot Neelesh!

      Yes it is Employee Time and it is working fine.

      Appreciate for your quick support!

      I am working on now how to get short hours and trigger short hours to employees via email.

       

      Regards,

      Utkarsh

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Thanks for letting me know Utkarsh..It is great news that you were able to use and test this approach. Also serves as a guidelines for other trying to configure this using the blog

       

      Author's profile photo Utkarsh Parikh
      Utkarsh Parikh

      Hi Neelesh,

      Can you please help me on below requirements?

      I want to trigger notification if an employee clock-in 30 mins after planned start time on previous day.

      Please advise.

      Regards,

      Utkarsh

      Author's profile photo Fahad AlGumaia
      Fahad AlGumaia

      Hi Neelesh,

       

      Thanks for blog, can we use the same solution for weekly time sheet? if user has not submitted previous week time sheet, then a notification should be sent to user. Any suggestions

       

      Regards

      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Hi Fahad,

      This is already covered in my blog..Please refer to

      Part 2- Notifications for Pending time sheet in previous weeks