Timely Time Sheet Alerts for no records on previous working day
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
Create a custom MDF that has the following fields
User -> External Code
Previous working day -> Date
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
Create an Alert Rule like below
The Alert Rule has to be attached to Post Save hook of the Custom MDF
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
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
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.
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
Senior Product Specialist, Best Practices for SF
Successfactors Product Management
Awesome Neelesh!! Wonderful Blog!! Timely information for my project - Thanks so much!!!
Thanks, Srinivasan for the feedback. Hope this helps in your project
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.
Is there a process for late coming to be counted as half day?
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.
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
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😉
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
That’s true! Thanks for clarification!
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)?
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!
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
Many thanks, Neelesh!
We followed blog successfully but still didn't received email notification for the same. can you please help with solution.
Thanks & regards
Please troubleshoot using the following mechanisms
We have deployed this solution in our instances including other partner/customer instances and it works fine for us
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?
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
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.
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"
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
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.
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
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.
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
This is already covered in my blog..Please refer to
Part 2- Notifications for Pending time sheet in previous weeks
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,
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
Many thanks for your answer, Neelesh!
Great Idea ! Much Useful 🙂
Thank you Vijey
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!
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
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?
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
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:
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:
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