function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sultansultan 

How to achieve when I update the account field by name billing street then the same field which contains in contact need to be updated by a Trigger written on Account object?

Best Answer chosen by sultan
Sonam_SFDCSonam_SFDC
Go through the following cook book article which has sample code and explaination which you can test on your ORG:
http://developer.force.com/cookbook/recipe/mass-updating-contacts-when-an-account-changes

All Answers

kanavkhuranakanavkhurana
Hi Raju,

If I understood your requirement correctly, you want that the Billing Street on all contacts should be updated once the Account Billing Street changes.
To do this, you will need a trigger and a workflow.
a. Create a trigger on Account, that only runs if the Billing Street changes, and blindly updates all contacts - this will run the workflow rule that you will create in the next step.
b. Create a workflow rule on Contact, that updates the Contact's Billing Street with that of the Account.

This should do it! Cheers!
Sonam_SFDCSonam_SFDC
Go through the following cook book article which has sample code and explaination which you can test on your ORG:
http://developer.force.com/cookbook/recipe/mass-updating-contacts-when-an-account-changes
This was selected as the best answer