Business Requirement
High Level Business Requirements:
- Plan should be created as on 01/01/1951
- All employees should get enrolled into plan from there hire date
- Frontloaded plan with Total Yearly Accrual of 24 days
- Plan Balance should be visible on hire date
- Employee should only be able to apply absence after completing 50 Calendar days in organization
Evaluating Options
Based on above table we could see that there are only two methods (namely Global Absence Entry Validation Formula approach or Eligibility based on length of Service Derived Factor on Absence Type approach where all rules are satisfied.
However, both of them have their pros and cons which are:
If you use Global Absence Entry Validation approach the absence type will be visible from day one but the benefit is that it will restrict absence recording via all ways (UI Entry / HDL / REST..etc)
On the other hand using the Eligibility based on length of Service Derived Factor on Absence Type the advantage is that the absence type will only appear for employees who have completed 50 days in organization but once the Absence Type is visible one might still go ahead and make a back dated entry.
But if we combine both the approach then I guess it would be the best solution.
We will demonstrate two options here:
- Approach 1 – Assigning Only Eligibility Profile
- Combined Approach – Attaching Both Eligibility Profile and Validation Formula
Note: We are not demonstrating the approach of only assigning the Validation Formula as in many cases business users should not view the Absence Type itself if they are not eligible. No point making the Absence Type visible and then throwing an error during Absence Recording ( this still can be a approach but probably not the preferred one)
Pre-Requisite Setup
We would need to have some basic setups to be done which will be common irrespective of the approach we follow.
These setups include:
- Creating Absence Plan
- Creating Absence Type
Creating Absence Plan
We will create an Absence Plan with following attributes:
Plan Name: Paid Absence
Legislation: US
Plan Type: Front-loaded , Yearly Repeating Period Accrual of 24 days
Enrolment Rule : As of Event
Plan Term : Calendar Year (Jan-Dec)
Creating Absence Type
Create an Absence Type (say paid Absence) which will be effective from 01/01/1951 and available for US Legislation and associate the plan created above with this absence type.
Nest we will need to create:
- Custom Message
- Custom Global Absence Entry Validation Fast Formula
- Eligibility based on length of Service Derived Factor on Absence Type
Creating Custom Message
We will create a custom message (namely ANC_NOT_COMPLETED_50DAYS_ERR) which will have following details
Message Name: ANC_NOT_COMPLETED_50DAYS_ERR
Message Number: 100000001
Message Type: Error
Application: Absence Management
Module: Absence Recording
Short Text: You can only record this absence after completing 50 days in the organization.
Creating Global Absence Entry Validation Fast Formula
We will create a custom fast formula (PAID_ABSENCE_VAL) and the formula text details will be as below:
Eligibility based on length of Service Derived Factor on Absence Type
We will need to create a “Derived Factor” ( we will name it 50 Days+) and attach it to Paid Absence Eligibility.
Navigation to create Derived factors is: Setup and Maintenance -> Derived Factors-> Length of Service-> Create
We will attach this derived factor to “Paid Absence Eligibility” Eligibility profile.
Now, we will create two new employees one with hire date as 01-Jul-2020 (here Length of Service is greater than 50 days, employee number 4665) and one with hire date as 01-Aug-2020 (here Length of service is less than 50 days, employee number 4666).
Approach 1: Only Associating Eligibility Profile to Absence Type
We will only associate Eligibility Profile to “Paid Absence” Absence Type as shown below:
Also we can check both the employees (Emp#4665 and Emp#4666) have got enrolled into “Paid Absence” Absence plan as of their hire date and both of them have an accrual balance (after running Calculate Accruals and Balances scheduled process)
Also, similarly if we check the absence recording page for both employees we should see that while Absence Type of Paid Absence is visible for Emp#4665 it is not visible for Emp#4666
Now since we are unable to view “Paid Absence” Absence Type for Emp#4666 we will not be able to record absence for this employee from UI but let us check can we record absence for this employee via HDL.
But if we navigate to the person record Emp#4666 on a future date (say 30-Sep-2020) and try to do a back dated booking of 27-Aug-2020 (when the employee has not completed 50 days) we are able to successfully submit the absence (which is against the business rules defined in the beginning).
Approach 2: Associating both Eligibility Profile and Validation Formula
In this case we will associate both the Eligibility Profile and Validation Fast formula to “Paid Absence” Absence Type
Now, if we try to navigate to Emp#4666 as on a future date say (30-Sep-2020)
Now If I try to perform a back-dated absence entry (say 20-Aug-2020) then I should not be allowed to record the absence (as the employee has not completed 50 days on the absence start date)
And we have accomplished this by using the Entry Validation Formula, if the Validation Formula would not have been attached then this entry would have gone through.
Absence Recording Via HDL File
We will take two absence records (per employee) with one absence record for today’s date (28-AUG-2020) and other for Future Date (30-SEP-2020)
And if we check the error details we would see that the absence records for Emp#4666 have failed (which is correct and aligned to our business rules)
Summary / Conclusion
So, this is how we can make use of both Eligibility Profile and Entry Validation Formula to ensure absence recording is not allowed via any mode (be it through UI or HDL / SOAP / REST / Web Service).
While in this example, I have used the 50 days restriction rule but can easily use any number ( any number of days instead of 50 days).
And with this I have come to the end of the article, I hope this was a good read.
Thanks all for your time have a great day ahead.
Downloadable Files:
PersonAbsenceEntry_4665_4666)Current_Future.zip