This section shows how to get and set the address from an Account using JavaScript by querying the CRM OData (REST) Service. This sets the contact address when selecting an Account as the Company Name field automatically (without requiring you to enter it again).


To make this example work, you must select an Account with the address fields populated with some data.


The following example works only if you select a company name for a Contact and not a parent Contact. However, after reviewing this example, you can modify it to work with parent Contacts if desired.

The purpose of this example is to show how you can consume an OData (REST) Service without having to build a .NET application or component to make some of ...

Get Microsoft Dynamics CRM 2013 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.