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

      44 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 U Parikh
      U 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 U Parikh
      U 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 U Parikh
      U 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 U Parikh
      U 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

      Author's profile photo Gabriela Moraru
      Gabriela Moraru

      Hi, Neelesh!

      Great blog, congratulations and thank you!

      Have a question: You mention that this is a sample rule and you can add additional 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 the if clauses of the business rule.

      There is no chance to have them included in a single variable? You need to create a variable per time type absence and a variable per time type attendance? Just worried as then I need to create 100 variables for a customer for which I need such a business rule 🙂

      Many thanks for your answer,

      Gabriela

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

      Hi Gabriela Moraru - Thanks for the feedback. Yes unfortunately as far as I know, we cannot read the entire time recorded in a single variable. You will have to use different variables (may be focus on top 5 mostly used ones).  You cannot also look up a timesheet as it contains data for a whole week.

      One more approach could be to make use of time collector Daily ones..Store recorded time in a daily collector which is also an MDF. Then lookup that MDF instead of employee time in a variable..This might work as daily collector will store the recorded time irrespective of time types used

      Regards

      Neelesh

      Author's profile photo Gabriela Moraru
      Gabriela Moraru

      Many thanks for your answer, Neelesh!

      Author's profile photo VijeyAananth SR
      VijeyAananth SR

      Great Idea ! Much Useful 🙂

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

      Thank you Vijey

      Author's profile photo Gustavo Tizeira
      Gustavo Tizeira

      Hi Neelesh!!!!

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

      In some industries (eg oil) for security reasons, it is necessary to know on the same day if the employee entered or not.

      That is, do not analyze this information the next day but on the same day.

      Is it possible on Time Tracking?

       

      Thanks in advance!

       

      Gustavo Tizeira.

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

      Hi Gustava

      Thanks for the feedback.

      For such cases, You can use the same solution I have but just modify the rules to check for current day and schedule the IC job every night same day after business hours

      Regards

      Neelesh

      Author's profile photo Cindy Lumbert
      Cindy Lumbert

      Hi Neelesh,

      Thank you for the blog. I am trying to set up the Part 2 requirement for a customer. I am struggling with the business rule. Using the parameters and scenario from the part 1 example, I do not see an option to query the Time Sheet Status. Do you have any additional tips that you can share on that?

      Thank you,

      Cindy

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

      Hi Cindy

      You dont have to query approval status in business rule. It is already done as part of filter in Integration Center. So the integration center already filters those records which are pending in previous week. Please look at the filter screenshot in option 2.

      And further when IC creates the MDF record, you can trigger an alert via an alert rule

       

      Author's profile photo Cindy Lumbert
      Cindy Lumbert

      Thank you Neelesh.

      That makes sense since the condition I want to query in option 2 is already available. I have been working through setting this up (with lots of help from colleagues).

      If I am understanding correctly for option 2, the process (once configured) would include the following steps:

      • Integration Center report is run
      • IC updates the custom MDF
      • Post Save Rule on the custom MDF triggers the notifications as the records are created.

      Thank you,

      Cindy

       

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

      Hi Cindy

      Yes your understanding is correct on the sequence of steps

      Regards

      Neelesh

      Author's profile photo Cindy Lumbert
      Cindy Lumbert

      Hi Neelesh,

      I am still struggling to get this to work for Part 2. We have set up the custom MDF, the Integration Center report, the Post Save rule attached to the custom MDF and the workflow.

      A couple of things that I don't understand still:

      • In the first part of the blog, the 'has records' field is updated from the On Save rule, which we don't have in the part 2 scenario. So, does the Integration Center need to have logic to update that field?
      • If so, will the IC report over-write as data changes? For example, an employee forgets to submit, so the IC report creates the record and an alert is sent. The employee then goes back and submits the time sheet. Will the next run of IC update the record in the custom MDF or create a new record?
      • In the screen shot of the MDF, there is a Notification Date field. Should this also be updated from the IC report? Or will this identify the new record if there are multiple records for each user?

      Sorry for all the questions, but the further we work through setting this up, I am unclear how it really should be working.

      Thanks,

      Cindy

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

      Hi Cindy

      Here are my responses

      • In the first part of the blog, the 'has records' field is updated from the On Save rule, which we don't have in the part 2 scenario. So, does the Integration Center need to have logic to update that field? - I did not mention this in part 2 since this is self explanatory. Yes you need to store the value in a custom field based on which you will determine if the alert is sent or not.
      • If so, will the IC report over-write as data changes? For example, an employee forgets to submit, so the IC report creates the record and an alert is sent. The employee then goes back and submits the time sheet. Will the next run of IC update the record in the custom MDF or create a new record? -  If the employee has submitted the time sheet next time, it should no longer be pending. There is filter at IC which only picks Pending records. So this record which is no longer pending is not picked in next run..
      • In the screen shot of the MDF, there is a Notification Date field. Should this also be updated from the IC report? Or will this identify the new record if there are multiple records for each user? - It is optional..In Reality not required if you always send notification as of today
      Author's profile photo Janeth Cáceres
      Janeth Cáceres

      Hi Neelesh

      In the example you use Employee Time Sheet as the initial entity.
      I am trying to create the integration but the system gives me the following message:

      Supported Operations***This entity supports no write operations. It is a read only Entity Type.**
      Thanks for your help
      Regards
      Janeth
      Author's profile photo Neelesh Kamath
      Neelesh Kamath
      Blog Post Author

      Hi,

      I think you also have employee time sheet in target (not sure how). Please check if you have two objects in the target (in mapping view). If you see also employee time sheet along with custom MDF, please delete employee time sheet from mapping view

      Regards

      Neelesh

      Author's profile photo Ragipani Preethi
      Ragipani Preethi

      Hi Neelesh

      Thank you for the blog! We were successfully able to run the report in IC and got the output that 360 employees received pending worksheet notification email.(As

      Part 2- Notifications for Pending time sheet in previous weeks)

      Our requirement is -Can we get that list of those 360 employee names/ID who received the notification email? As the report only gives the total number.

      Kindly confirm.

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

      Hi Preethi

      Thanks for the feedback that it helped you

      The data is stored in the MDF before notifications are sent out. I know at a high level you can create reports on MDF via SAC or Advanced reporting . Since I am not a reporting expert, please check with a reporting expert. It should be possible to report on MDF

       

      Author's profile photo Shukla Vaishnavi
      Shukla Vaishnavi

      Dear Neelesh,

      Thanks for this wonderful blog.I followed first part it worked well.But, I am struggling with second part I have created time sheet pending notification object and applied filter in IC and created post save rule as told by you in part 1(with if condition always true) but I am confused what to put in on save rule..?

      please explain business rules for part 2.

      Best Regards,

      Vaishnavi

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

      Hi Vaishnavi

      Thanks for the feedback

      For the second part, the IC filters are already filtering the pending records from previous week. Ideally you don't need an on Save rule but if you want to set a flag , you can set some flag and no if condition

      Then Just create an alert rule to send an alert on notification date set on MDF.  This should work 

      Regards

      Neelesh

       

      Author's profile photo Shukla Vaishnavi
      Shukla Vaishnavi

      Hi Neelesh,

       

      Thank you so much for clarification. I understood your point. It worked. 🙂

       

      Best Regards,

      Vaishnavi