A great new feature in Microsoft Dynamics CRM 2013 are the Composite Controls. This blog goes into detail about these new controls.
With this new control comes many questions about how configurable the controls are. As of right now, they’re not configurable. All you can do is add/remove the composite control from the form using native customizations. For example, the address1_composite field is the composite control for address 1 on the Account form. This shows up at as “Address1” in the Field Explorer when on the Account form.
However, at the CRMUG Midwest (Chicago) Regional Chapter Meeting this past Thursday 12/5, we found out about a neat trick using another new Dynamics 2013 feature - Business Rules (thanks Richard Knudson!). You can use Business Rules to show and hide fields on the form, which also has the positive side effect where this applies to fields in the Composite Controls. So, at the very least, you can hide fields that aren’t needed in certain countries or regions of the world, and show them in others.
An example would be to show/hide parts of the address that don’t pertain to certain countries. For simplicity sake, we’ll hide the Address Line 3 field if the country isn’t “U.S.” and show it otherwise. In order to do this, we create two Business Rules on the Account entity as outlined below.
Now let’s see this in action. If you set the Country to “U.S.”, you’ll see Address Line 3 in the Composite Control, and if it’s any other value, it’ll disappear.
The same sort of trick applies also to setting the requirement setting for fields. If you use Business Rules, the rules you build won’t only apply to fields on the form, but also to fields in Composite Controls.
While this is a great neat trick, a big request that we have is to be able to add a custom lookup field for Country and even State. This way administrators can control the data that’s entered and prevent allowing any data in a free form text field. You can do this with CRM currently, but you can only add it to the form. You cannot add this new lookup field to the Composite Controls. We’ve logged this Microsoft Connect request and hopefully in future releases / Update Rollups we’ll se more configurability added to this great new Composite Control feature.
However, you can use the Business Rule trick above, along with new lookup fields, if you also have some logic that populates the native text fields based on the selection of your custom lookup fields. You can also then make the native text fields read only, so it looks to the end user like you’re displaying the custom lookup field in the composite control. This is a workaround that isn’t too difficult while hopefully Microsoft makes this more configurable using the form designer in the near future.