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 !
Nice Post! See https://ericsplayground.wordpress.com/blog/ for a great way to document your Process Builders.
LikeLike
Thanks Eric !
LikeLike
In my salesforce account, AccountID is not showing when i went to select this step:
” Field equals “Account ID”, operator equal to “equals”, Type equals “reference” and value equals “Account ID” from the dropdown. ”
can you tell me why i am facing this issue?
Note: I am using Developer Organization
LikeLike
Hi Kumar,
I have noticed this issue. The developer orgs created after Winter’17 release shows the label as “Master record ID” rather than Account ID. So in your developer org, in the filter options you should find “Master record ID” which is nothing but your Account ID. That should fix your issue !
LikeLike
I know this is a reply to something old but the “Automate Basic Business Processes with Process Builder” lab in the Trailhead relates directly to this issue. I set the “Master Record ID Equals Field Reference [Account].Id” in the condition but the update in the Contacts object never happened. It wasn’t until I selected “No criteria…” that the update took place. At this point, I’m not sure how to relate Contact records to a specific Account record.
LikeLike
Hi Akhil.
Its cleared Account Id issue.
Thank you.
LikeLike
@Akhil Anil: Is this logic works if an account has more than 100 contacts?
LikeLike
Yes, It would work with 100+ Contacts provided that you have set a lower batch size (below 60) when mass updating your accounts.
LikeLike
Hi Akhil,
I just tried this for our two custom objects (Project and Deliverable), with the aim of the Notes field (long text) in the Deliverable getting updated every time the Notes field in the Project is updated. The Notes field in the Deliverable should not be editable (only in Project).
I got stuck in the Immediate Action filter, the only fields with “ID” are the following and I don’t think not one of them is correct:
* Created BY ID
* Record ID
* Last Modified By ID
* Owner ID
* Record Type ID
Would appreciate any help you can provide. I will repost this in the Success Community in case someone else has an idea on what I am doing wrong.
Thanks,
Marge
LikeLike
Hi Marge,
You should find a field named as “Project__c” in the filter. Please post the screenshot here with the list of fields that you see, if you don’t find it there.
LikeLike
Hi Akhil, Thanks for this! We have the affiliated contacts related list, not contacts on the account. The connection between contacts and accounts lives the Primary Affiliation lookup field on the contact record. I noticed that Affiliated Contacts is not an object available to me when I am building my criteria. I chose “Contacts” instead and followed your instructions, but the process did not update the field on the contact object that i needed it to update. Any thoughts?
LikeLike
Hi Katie, I believe affiliated contacts is one of your custom objects ? In that case you will have to refer the respective custom object in your process configuration. There could be a possibility that the API name of your custom object is something else other than “Affiliated Contacts” ?
So please double check the API name.
LikeLike
HI ,
I have a similar kind of a process builder, however its not updating all the child records were as only updating the latest child record.
Please advise what could be the issue?
Thank in Advance!
LikeLike
Hi Akhil,
I tried the above steps for custom objects and it doesn’t works for me.
Any thoughts?
Thanks
Best Regards
Saroja
LikeLike