With Microsoft Dynamics CRM 2016 Service Pack 1 and CRM Online 2016 Update 1, Microsoft introduces a new field type for custom entity attributes: the Customer field type. As many who have spent time building xRM applications know, this has been an ongoing request to the application team. The CRM Help and training documentation provides a nice summary of the new feature:

A lookup field that you can use to specify a customer, which can be an account or contact.
Previously, several out-of-the-box entities in Dynamics CRM, such as the Case, Lead, and Opportunity, entities contained a special kind of lookup field that represented a customer. Using this lookup field you could choose between two entities: Account or Contact. With the new capability, you’ll be able to use the Customer field with many other entities to track the customer information you need. For example, using the Customer field, you can indicate if the customer is a company or an individual.

The How To

So, system customizers and developers can now include a single field linked to either an Account or a Contact that operates identical to system entities! Why is it a big deal? In previous versions, if you wanted provide similar functionality, your steps might look something like:

  • Add relations to both Contact and Account
  • Add fields to the form for both Contact and Account
  • Add validation to ensure that either a Contact or an Account was selected, but not both
  • Add validation or checks to any custom plugins or workflows that trigger on the custom entity
  • Add validation or checks to any custom reports for custom entity

This configuration would still not provide a single field on the form for the end users without some serious unsupported code! These steps make assumptions about the business requirements (and exaggerate a bit), but I think it demonstrates the general idea. System customizers and developers had to jump through a few hoops in order to provide the option of linking to multiple entities that represent a single relationship.

With the new field type of Customer, you can now simply add a new Field with the type specified as Customer:

Adding a new field of type Customer

Adding a new field of type Customer

You can see that it will auto-magically add the required relations to Account and Contact from this dialog. Once crated, you can add the field to the form just like any other lookup but your selection options now provide the familiar selection for both Account and Contact:

Select from both Account and Contact

Select from both Account and Contact

Given my simple testing so far, I think this feature offers users a much cleaner and familiar user experience while streamlining efforts for your implementation team.

The Why

This all sounds very cool, but where you would use it? Why not simply leverage existing system entities through customization?

For some projects, your team may not have the option to leverage system entities because of the possible impact to concurrent solutions, or it may simply be too much effort to suppress system functionality. In these cases, we usually turns to custom entities to accomplish deliver required functionality. And as you know, custom entities do not offer the same functionality as many system entities!

One simple example could be a membership organization that collects dues from either individuals or organizations, such as a club or professional membership organization. One design option for your implementation team is a custom entity representing Membership for either an individual or a company, saved as Contacts and Accounts respectively. This entity may include membership start and end dates, links to payment information, membership level details, etc. In previous versions of CRM, your team may need to take the steps described earlier to create relations with Contact and Account. The new Customer field would simplify your design by narrowing down your users’ input, your time customizing the entity, and any further customizations around the Membership functionality.

Further Reading

Overall, this sounds like a relatively small update, but I think it’s a definite time saver for system customizers and developers. I suggest grabbing a test instance online and trying it out yourself. I would be interested in hearing about any issues or gotchas with this new capability.

In the meantime, here are some links for further reading on the new feature:
Microsoft Dynamics CRM Help & Training – Create or edit entity fields
https://www.microsoft.com/en-us/dynamics/crm-customer-center/create-or-edit-entity-fields.aspx

Dynamics CRM SDK Online documentation – Create a customer lookup attribute
https://msdn.microsoft.com/en-us/library/gg509035.aspx#BKMK_createcustlookup