In this blog post, we will see how can we validate the dependents details while employee claims for a benefit. Here we will take the scenario of Marriage Benefit/Gift.
The employee should not be able to apply for Marriage Benefit/Gift if the spouse is not updated in the Dependents/ Family Details Portlet.
We are going to validate this with the help of a business rule.
Write a Business rule with the scenario Rules for MDF Based Objects and purpose as Validate.
Select the base object as Benefit Employee Claim.
This rule actually compares the count of dependents of the user who is going to claim the benefit.
Here ‘1’ is the external code for picklist value ‘Spouse’. The count will be zero if the employee has not updated the spouse. Since we have kept count less than 1, the system throws an error while the employee tries to claim the marriage gift/benefit.
Assign this rule in the Object Benefit Employee Claim at the Save Rules section. This can be done by the Configure Object Definitions tool.
Configuration is completed!
Now let us test the configuration
- An employee who has not updated the Spouse in the Dependents details.
2.Employee tries to claim the Marriage gift/benefit and system throws error as per the configuration.
This function can be used in many other scenarios other than benefits, wherever we want to count the number of dependents.
Hope this blog post was helpful.
Stay happy. Thank You!