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
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.