This is regarding calculating accruals based on dependent age. I have seen many such questions floating around the customer and partner community. Hence wanted to share a possible solution for now.
Let’s look at a sample requirement “A customer’s requirement is, that Vacation days are added for each child under 12 years of age”. For example, if there are 3 children and only 2 are below 12 years, the accrual should be 20 (2 * 10 days per child). “
Currently, there is a function to get the count of dependents but it just returns the count for each relationship type and may not be of help here for this kind of scenarios
Coming to my solution, you can follow the below steps and check the results yourself. Further, you can adapt
1. Create a custom field in Dependents “IsEligibleForAccrual” using BCUI.
2. Create a new on Save rule on the same dependent portlet to set this custom field based on your requirement of 12 years (144 months)
3. In the accrual rule use cardinality rule function to check the number of dependents matching this field as “YES”
The current employee has two eligible dependent Childs
In my sample rule, I am providing 10 days per dependent matching the criteria
The accrual granted is 20 days which is correct in this case
Integration Center to update dependents in subsequent years
The eligibility of existing dependents which were added after the employee is hired can change in subsequent years. For example, If there is a child born in 2008 would become 13 years in 2021. As a result, at beginning of 2021, we need to update this eligibility field to “NO” so that the accruals for 2021 can consider this
To achieve this consider the below design
Create a outbound integration to output the current dependents in system into a csv file in SFTP folder
Add a calculated field named “Years” and add the following calculation
This gives the difference between the date of birth of dependent and today (Jan 1st of every year)
Sample file extracted
Create an inbound integration to read the csv file (exported in above step) from SFTP folder
Map the fields Person ID External , Related Person ID External
Make Start date as calculated field which is resolved to today or NOW
Also make the isEligibleForAccrual as calculated field with below calculation by using “Choose” Operator
It is a switch case where if the Years field from CSV is between 1 to 12 , it will be set to YES
After I run the integration centre report, the dependent who is now 13 years in 2021 is updated
You can schedule these integrations every year (Beginning of Jan) if your accrual calendar year is Jan – Dec. This would ensure that the dependent’s eligibility is set as per their age at that moment.
Post this, you can run the accrual calendars for this time account type
- Instead of years if you want months, you need to add numbers from 1 to 144 in your switch case, as in IC the if else condition does not provide filters less than currently
- You can add additional time based filters to prevent reading all dependents . This can depend on your use case
The current solution does not cover accrual recalculation for ex: when a new eligible child is added. But such challenges can be overcome by scheduling periodically the time off calendars.
If I get a way to automate this step as well, Will enhance this blog or create a new one.
Also please evaluate this with your customer, before adopting the solution.