Hello Everyone

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

# Procedure

** **

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”

# Testing

** **

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

Disclaimer:

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.

Thanks

Neelesh

Nice blog Neelesh Kamath and I have a small query on Treat Null As() function you used TREAT NULL AS() function because to avoid inconsistency if there are no YES records in the system, correct me if I’m wrong.

Considering your example there are 2 YES records, so first system checks whether there are none of YES records maintained and if none YES records exist then rule will update the VALUE with 0; when multiply any number with 0 will be 0 so no output and if YES records are maintained then the VALUE will be 2( based on example) and Factor is 10 so output will be 2*10=20.

My Query is what happens if we directly use Cardinality function in VALUE field, will system throw error or Accruals will generate with different value?

Thanks,

Parthu.

HI Parthu

Thanks for the feedback. I generally use Treat Null As with all these functions as some return NULL and some a numeric value. Hence Do not want the rule to fail because of an unhandled null case.. But I guess for Cardinality you can make use of the function directly on the value as it is numeric.

Please give it a try

Thanks

Neelesh