|Summary:||Instructions on how to set composite field labels in Microsoft Dynamics 365 / Dynamics CRM|
|Article Type:||Information / Troubleshooting / Support|
|Related Product(s):||This article relates to the following products:|
Since the 2013 version, Dynamics CRM has come with Composite Fields for address data. This vastly reduces screen real estate to store addresses and as a result looks a lot tidier. Here’s an example of how it looks:
Clicking the Composite Address field will cause a fly out of the individual address fields. The problem here is that changing the labels of these fields within the fly out is not achievable by changing the labels on the form, simply because they do not exist on the form, only part of the Composite Field. This is slightly annoying here in the UK and other non-American countries where we may wish for the State/Province field to read County, and the ZIP/Postal Code to read just Postal Code.
First we need to get the names of the labels of the fields we wish to change. I wish to change the aforementioned fields, State/Province and Zip/Postal Code. The names are these are:
If you wish to retrieve any of the others open up a form with a Composite Field on (I did this in IE11), click in one of the input boxes, before right clicking your mouse and selecting Inspect Element. This will open the browser developer tools and display the following.
The name we want is highlighted below in red.
Save the above file and add it as a Web Resource in CRM.
Next navigate to the form where the Composite Field is located and load the script with the form, before adding the OnLoad event. It should look something like the following:
Save and publish your changes.
Once you have refreshed your page you should now see the following changes to your Composite Field.