In the real world, our customers are either individuals or a group of individuals such as a company. However, Microsoft has always made a distinction when it comes to how we organise our data models especially with custom entities – you’re either one or the other, requiring separate lookups for each.

Not anymore! One of the neatest new features of Dynamics CRM Online 2016 Update 1 (CRM 2016 SP1 for On-Premise) is the introduction of a new Attribute Data Type called “Customer”.

introducing-the-customer-data-type

 

A Customer Data Type is a form of Multi-Entity lookup—one which when selected, you can choose between different entities. You may have seen Multi-Entity Lookups used commonly throughout all previous versions of Dynamics CRM—for instance, on activity entities where you can select either a Contact or an Account or a number of other default entities. But previous versions have not allowed you to create your own multi-entity lookups without some extensive JavaScript customisations. That has changed with the introduction of the Customer Data Type.

Here’s how to create a Customer Attribute:

  1. When creating your field, select the Data Type of Customer from the drop down menu.

create-customer-attribute

  1. Check that you’re satisfied with the predefined relationship names “To Account” and “To Contact”.
  2. Save and Close.
  3. Navigate to your Main Form designer.
  4. Add your newly created field (in this case Related Customer) to your form.

main-form-designer

  1. Save and Close.
  2. Publish your entity changes.

How to use the Customer Attribute

Upon opening the form with the newly created Customer attribute and navigating to the lookup “More Records” function, you will see a drop down selection on the pop-up dialog allowing for switching of contacts and accounts.

  1. Go to your newly created lookup.

customer-attribute-new-client-activity

  1. Select Look Up More Records.

look-up-more-records

  1. Change Look For option from Account to Contact.

change-look-for-option

  1. You will see your lookup view updated to target contacts.

updated-lookup-view

 

If you’re developing code for this new attribute, make sure you look at the sample code to create customer relationship at the MSDN website.

This is one of my favourite enhancements to the CRM platform, as it allows us to simplify entity design and gives us a supported way to achieve multi-entity lookups. Presently, it is limited to just Contact and Accounts, and I personally hope that Microsoft opens the possibility of having custom entities included in future releases.

If you have any comments about this blog post, please leave a message below.