Process builder is one of the most powerful tools of the Force.com platform that will help you to setup many business processes without writing a single line of code.
In this post I will walk you through the steps to build a process that will be triggered for any changes in a parent record which will eventually update the child records.
Use Case: ABC company has a custom field called “Track” in Account and Contact the values of which should always be in sync with each other. So, they expect that any time the “Track” field in Account is updated, the corresponding field i.e. “Track” in Contacts should be updated with the same value. This can easily be accomplished using a formula field in the Contact. However, ABC also wants to ensure that the Track field in Contact should be editable. If a user wants to have a different value in one of the Contact, then they should have the flexibility to do so. Process builder is undoubtedly the way to go for such scenarios.
Implementation: Follow the below steps to create this process
- Go to process builder and create a new process with a unique name.
- Click on “Add Object”
- Select “Account” from the Object drop down list.
- Select the criteria “When a record is created or edited” in the criteria to “Start the process”.
- Click “Save”
- Click “Add Crietria”
- Give your criteria a unique name. I will call it “Check if track changed”
- In the “Criteria for Executing Actions” select “Formula evaluates to true”
- In the formula box enter the formula as ISCHANGED([Account].Track__c )
- Note that always use the “Insert field” option to select the API name of the field.
- Select “Add Action” in the immediate actions
- Select “Update records” in the Action type
- Give your action a unique name
- In the “Record Type” select “Select a record related to the Account” and Select “Contacts”
- In the criteria for updating the records select “Updated records meet all conditions”
- In the filter to update the records, select the filter as below
- Field equals “Account ID”, operator equal to “equals”, Type equals “reference” and value equals “Account ID” from the dropdown.
- In “Set new field values for the records you update” select the fields as below
- Select field equals “Track”, Type equals “Reference” and value equals “Track”.
Click Save and Activate your process. The process should look like below.
You can now test the process by changing the values in your Account field and see if they are getting reflected in your Contacts.
Feel free to comment if you have any doubts
Happy using Process builder !