Skip to main content
Create roll-up summary field using flow builder in salesforce
Create roll-up summary field using flow builder in salesforce (suppose Parent is Account and Child is Order)
Steps:
1. Create a custom Roll-Up field for an Account suppose 'Total Order'.
2. We can a custom object if we don’t have and add this Look-Up field to the object. That is here Look Up is to the Account Object.
3. Now lets create the Flow that will Sum Up all Order records linked to a specific Account.
Create a variable that accepts Account ID as a parameter > Create a variable that will aggregate the Order > Once we get the Account ID, we need to get all records related to it > We can also set up a filter to get just needed records (Here lets get all Orders that are linked to the Account and the filter criteria like the records with 'Activate' status > Make it to store all Records and choose fields to store in the new variable > Once we have the new variable with the data, we need to create a loop that will get the Order from each record and add it to the variable that aggregates the data > After each iteration we need to update the variable > We need to add Value to the previous Order > Finally, lets update the Total Order for the Account.
4. Process Builder - The process will be launched if we create or update any record for the Order object.
Once a record is created or updated, the process will launch the flow and pass the needed parameters to the flow that is Account ID.
Comments
Post a Comment