Product Information
Negative Time Recording Workflow Handling on Manual Changes by User
In many companies, we see a requirement where employees are required to enter only exceptions against planned times. The employee uses negative recording, and the background job triggers the submit of the timesheet at the end of the timesheet period. And when an employee has entered the data in the timesheet, the workflow should be different than in the cases where the admin or manager has entered timesheet data.
When the job triggers every Sunday (assuming Sunday is the end of time sheet week), we need the workflows to be triggered for employee input only and it should go for Manager approval. Further, for Manager or HR input no workflow should be triggered and the timesheet should be set to approved status.
So for a negative time recorder, the Employee may just go to the timesheet for a particular week and add some exceptions (against planned hours) and save. Later on, managers or HRs, or Admins can perform some manual changes as well. So we need a tracker to indicate that the employee had touched the timesheet at some time for a particular week before it gets submitted by night job. So when the night job runs to submit the timesheet we use the tracker to determine if at all employees had touched a particular timesheet week. Based on that either send for approval if (yes) or Auto Approve the same (if no).
Solution Overview
- Add a custom field of type Boolean to the Employee Time Sheet.
- Set the field to true when the Login User() is the Time Sheet User (-> ESS Scenario, Employee did the change in the Time Sheet)
- Only trigger the workflow when the field is true.
Add a custom field “Employee Changed” as shown below:
Configure a business rule to check if the login user is the same as timesheet user and add this to onSave hook of “Employee Time Sheet” Object Definition. The rule sets the custom field to “Yes” if the time sheet was saved by the employee and sets this to “No” if it is saved by others (managers, admins, HR etc)
Create a workflow Rule to check if the custom field value is “yes” and accordingly trigger a workflow for manager approval
For other cases, the workflow is auto approved.
Attach this workflow rule on onSave hook of object definition “Employee Time Sheet”. Add this rule in order below the rule which sets the custom field which was described in above step.
Testing
Employee saves the time sheet manually. Status of time sheet is “To Be Submitted”
The custom field “Employee Changed” is set to “Yes”
Time sheet Job is run from provisioning
We can see that the workflow is set to “To Be Approved” Status as expected and the corresponding workflow is triggered as shown below
I would also like to thank the Time Product Management team for providing ideas and support on this blog
Hope you liked the blog
Stay Safe
Best Regards
Neelesh
Senior Product Specialist, Best practices for HXM
SuccessFactors Product Management
Hi Neelesh,
Can we not just use if query to check if the login User employee and target employee is same, do we need to have a custom field?
we had a situation where we wanted to identify who has made the changes, for reporting. We used 2 different attendance type, system generated was maintained in time profile config as main attendance, this was not visible to employees. A similar attendance was used and visible to employees. Both the attendance had same output time type group for payroll processing. If employee makes a change it will overwrite system generated and it be caught in reporting.
Regards
Sanjay
HI Sanjay,
Yes the login user and target logic would work for a positive recorder when you submit the timesheet from UI. You are right on this.. The blog is about Negative time recorder where the system user will be used to submit the workflow. In such a case, we cannot rely on login user as the system user will never match the employee ID during submission of workflow.. Hence for negative time recorders , we store a tracker to determine if at all employee had touched the time sheet for a week and use that field when the backend job submits the time sheet for workflow
Regards
Neelesh