News Ticker

How can we customize the Address Composite Control?

In the last post we discusses about customizing Name composite field, in this post we would discuss about Address composite field. Unlike Name composite control, Address is actually an entity in the system. The address composite control is built based on the Address entity.

Address composite control is build of Street, City, State/Province, Postal Code and Country fields.

However unlike Name composite control, the constituent fields of Address composite controls cannot be renamed from the UI. The constituent fields of the Address composite control do not appear to use the field display names, and instead appear to be hard-coded into the composite control.

The Address composite control is ONLY available for Account, Contact, Lead, Competitor, Quote, Order, and Invoice; but not available for User, Business Unit, and Site entities.

Address Flyout

Now we would explore the customization options of the Address flyout.

How to set the value of a field inside the fly-out menu?

For example, how do we default to Country to always Australia. We can do this by using a Business Rule.

Set the Country to Australia

The other way to achieve the same behavior is by adding the following Java Script code:


N.B. : When both Business Rule and Java Script is added to modify the same field, the Business Rule wins! For example, if we add a Business Rule to default the Country to “Australia” and a Java Script to default it to “USA”, the user would find the Country value to be “Australia”.

How to hide fields in the fly-out menu?

Sometimes, we want to hide a field from the address flyout like State/Province. For example, countries like UK or New Zealand does not usually use State/Province in their address.

Hide State field

To achieve the same result using a Java Script, use the following script:


How to make a field Business Required in address fly-out menu?

Making some address fields mandatory is a normal business need. Let us here try to make Street1, City, ZIP/Postal Code and Country/Region field Business Required.  Making the fields Business Required would make them mandatory in the Address flyout as well.

Mandatory Address Fields

However, we can make a field Business Required using the following Java Script code as well:


How to change the label of fields in the fly-out menu?

The address fields however cannot be changed through the UI. These do not to use the field display names, and instead appear to be hard-coded into the composite control. There is no supported way to change the labels of the fields. The supported control.setLabel() Java Script API does not work as we cannot get the control of the field inside the fly-out menu.

About Dipankar Bhattacharya (59 Articles)
A multi-skilled Dynamics 365 Professional with strong experience in delivering IT projects especially across multiple industries. A Microsoft technology evangelist, a regular speaker at tech events, blogger and avid reader. Certified IT Architect and well versed in Solution Architecture of Business Applications using Microsoft platforms like Dynamics 365, Azure and Office 365.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: