one comment

How to update a related record when the main record is updated using Workflow

In some scenarios it is required to automatically update a related record when the main record updates. For example, when an Account address is updated, all related Contact records address should update respectively.

This problem can be solved by writing a custom plug-in component but here is a another approach, based on a Workflow rule without any code writing:

1. Create a new workflow for the Contact entity

Create a new workflow for the Contact entity 

2. Set the workflow rule to fire when a record is created and also when the Address attribute is changed. If you want this rule to apply to existing records, check the On Demand checkbox. Later on, apply the rule to the relevant existing records.

Set the workflow rule to fire when a record is created and also when the Address attribute is changed 

3. Add a Wait Until step to wait till the Contact’s address is different from Parent Account address.

Add a Wait Until step to wait till the Contact’s Parent Account record has updated. Alternatively, you can wait till the Parent Account address attribute is updated 

4. Add a Update record step for the Contact record and set the address to map to the Parent Account address

Add a Update record step for the Contact record and set the address to map to the Parent Account address

Add a Update record step for the Contact record and set the address to map to the Parent Account address 

5. You are done. Save the rule and publish it. Test the rule by creating a new Contact and relating it to a Parent Account or by applying it to an existing Contact record. Change the Parent Account address and watch the rule advance. When it completes, open a related Contact record and make sure the address was updated according to the Parent Account.

Add comment " class="ir icon-in">linkedin twitter email