Restrict Editing Leave Requests Created by an Admin
Thanks to employee self service possibilities, employees typically create leave requests on their own – without the need to involve their manager or time admin. Nonetheless, there are still plenty of use cases where an admin needs to create the leave request on behalf of the employee, for example because an employee falls sick for a longer period of time and does not have access to the system. In such cases, it might sometimes be required to keep employees from editing such absences afterwards.
In this blog post you will learn how to prevent employees from editing leave requests that have been created by an admin.
- Go to Admin Center > Configure Object Definitions > Object Definition > Employee Time and add a read-only custom field of data type ‘User’:
Note: If you don’t want the custom field to appear on the absence request form, you can set the field to invisible once you have completed the configuration.
- Additionally, add a save rule, that automatically sets the custom field to the login user, to the employee time object definition:
The standard “Created By” field can’t be read in the rules. Hence, a custom field that is filled with the user who creates the absence is required.
- Go to Admin Center > Configure Business Rules > Create New Rule > Time Management > Absence Validation and create a take rule which is assigned to the relevant time types:
In step 1, instead of a ‘User’ custom field, one could also create a ‘Boolean’ custom field like “Is Requester Admin”. In this case the save rule (step 2) would be configured in a way that it checks already during save whether the login user is part of the admin permission group and if so, set the field to “Yes”. In the take rule (step 3) you would then only check whether the custom field is set to “Yes”.
Advantage: If an admin creates an absence, and then changes role and is not part of the admin permission group anymore when an employee wants to edit the absence, this is not taken care of and employee would be able to edit the absence.
Disadvantage: The rule execution during absence creation takes longer. As create is more common than edit, it would be better to put the longer rule execution onto the take rule when editing the absence.
- Admin creates an absence for employee Jennifer Jackson:
–> custom field is set:
- Admin tries to edit the absence which is possible as she is part of the “Admin” permission group:
–> no error message
- Proxy as Jennifer Jackson and try to edit the absence:
–> Error message pops up
This blog post explained how to prevent employees from editing leave requests that have been created by an admin by using a custom field, save rule, and take rule. By this, the solution once more shows the tremendous flexibility of SAP SuccessFactors Employee Central Time Management.
The solution might be extended / amended as per your customer’s individual needs.
Looking forward to your thoughts and comments.
Image/data in this blog post is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.