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”.
Here’s how to create a Customer Attribute:
- When creating your field, select the Data Type of Customer from the drop down menu.
- Check that you’re satisfied with the predefined relationship names “To Account” and “To Contact”.
- Save and Close.
- Navigate to your Main Form designer.
- Add your newly created field (in this case Related Customer) to your form.
- Save and Close.
- 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.
- Go to your newly created lookup.
- Select Look Up More Records.
- Change Look For option from Account to Contact.
- You will see your lookup view updated to target contacts.
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.