Introduction
A little strange it may sound first time but there are business use case where-in we want to have an absence type which should allow absence recording only if done via some specific users. Those users will be able to apply the absence for everyone but no-one else should be able to record absence apart from them.
The delivered application functionality categorises users into:
- Employees
- Line Managers
- Administrators
But any further bifurcation isn’t delivered. This essentially means that an absence type can be enabled only for Administrators but we cannot restrict this to ensure that only ADMIN1, ADMIN2 can record absence against it but not all other Administrators.
In this post, we would demonstrate how we can achieve this functionality through a custom solution.
So, let’s get started.
Worked Out Example
We would have to perform a series of setups to achieve this functionality. We can break them down into the following steps:
- Create Absence Type
- Create a Custom Profile Option (Assign Values to Specific Admin Users)
- Create a Custom Table Value Set
- Create a Custom Error Message
- Create a Custom Fast Formula of Global Absence Entry Validation Type
- Attach the Custom Fast Formula to the Absence Type Created at Step 1
- Verify Results
Create Absence Type
We will create a simple Absence Type (say “Special Leave”) and the important attribute values are mentioned in table below:
Create Custom Profile Option
We would need to create a custom profile option (ALLOW_SPECIALLEAVE_ABSENCE_BOOKING which would hold ‘N’ at Site Level and ‘Y’ for Admin Users HCM_IMPL and HCM_IMPL1 who are authorised to record absence. All other Admin users do not have a entry here and hence they should not be able to record the absence). Details of the profile option are below:
Navigation-> Setup and Maintenance->Manage Profile Options-> Create
Assign Profile Option Values
We will assign profile option values for this newly created profile option.
Navigation->Manage Administrator Profile Values->ALLOW_SPECIALLEAVE_ABSENCE_BOOKING
Create a Custom Table Value Set
We will now create a custom table type value set.
Navigation-> Setup and Maintenance -> Manage Value Sets -> Create
Create Custom Error Message
We would now create a custom error message.
Navigation-> Setup and Maintenance->Manage Messages -> Create
Create Custom Fast Formula
We would now create a custom Fast Formula of Global Absence Entry Validation Type.
Navigation-> Setup and Maintenance-> Fast Formulas -> Create
Assign Validation Fast Formula to Absence Type
Now we will attach the Fast Formula to Absence Type
Navigation->Setup and Maintenance -> Manage Absence Types -> Special Leave
Verifying Results
Now we will login with an ADMIN user (HCM_IMPL2) who is not allowed to record absence booking for “Special Leave” and check result.
We will now login with another ADMIN user (HCM_IMPL1) who is authorized to record the absence and verify result.
Summary
So, this is how we can make use of Global Absence Entry Validation Fast Formula to restrict absence booking for specific users. While in this example we have used controls on Admin users the same logic can very well be applied for line managers and employees too.
And with this I would end this post.
Hope this was a good read, Thanks all for your time and have a nice day ahead.
The supporting files can be downloaded from the links below: