Sum up values of MDF object on parent object
Did you ever want to sum up the values of an MDF child object on the parent object and couldn’t find a way to do so?
If you answered yes – we have solutions for you with our latest 1H 2022 release.
We had quite a few customers asking for an option to calculate the sum of field values of a collection. This means, that customers had created MDF objects with a one-to-many composite child association and now wanted to sum up a field value of the child records.
We have introduced a new rule function called ‘Sum Of Collection Field Values’
This function sums up the values of a collection field that meet the conditions.
The pre-requisite is – a “parent-child” association between objects, a collection.
The function has two parameters that need to be maintained.
The first parameter is to select the collection. Collections can be recognized via the “stack” icon on the user interface. The collection needs to be a Metadata Framework object.
The second parameter is to select the field in the collection that contains the value that you want to sum up.
Behaviour in case of errors:
If Collection is “null” or empty, the system returns the number 0.
If the field value of a data record in the collection is “null”, the system uses the number 0 for this data record when calculating the overall sum.
You want to see the total amount of travel costs. You’ve created a custom parent object called “Reimbursement for Travel Costs” that has a child object called “Cost Types” that contains several child records, for example, for hotel and flight costs. You create a rule that uses the function Sum of Collection Field Values to get the overall amount of all travel costs on the parent object.
A special thanks to Sylvia Strangfeld and the team for introducing this feature in the SuccessFactors system
There are a few more rule functions introduced in 1H 2022 release. Click Here to know more about these rule functions.