One of the most common requests that we have on any CRM project is to update child entities when a field changes on the parent record. This usually meant writing a plug-in in C# to handle this because it was quick and pretty easy to do. With the introduction of the REST End-Point in CRM 2011 you can accomplish the same thing with about the same amount of code but you don’t have to know C# to do it, just a little bit of JavaScript.
There is one downside to this method though. If the parent entity is updated through a workflow/integration or other custom code that runs behind the scenes then the script will not execute because the change was not made through the form itself. In situations like that, then you would have to use a plug-in as opposed to JavaScript.
The attached code demonstrates how you can use the REST Endpoint and JavaScript to update the Phone Number on the Contact whenever it is changed on the Parent Account.
Updating Child Contacts Using REST
The CRM 2011 SDK also has some great information on using the REST Endpoint with JavaScript as well.
Jeremy






Hallo Jeremy,
first of all thank you for sharing this code with the rest of us. I needed the same thin within an Opportunity and Opportunity products. In ordet to test the code, i created a “test” Field in both Accounts and Contacts. Then I replaced the “Telephone” variable with the “test”. Unfortunatel the code does not work.
Thank you
Tim