With the new update to Dynamics CRM, one the last outstanding issues with small footprint but big impact is the addition of a Customer field type. Where before we had to hack all kinds of approaches to reference either an Account or a Contact, now we can easily do it on any entity type. Hurray!

In order to add a Customer field, modify an existing form or create a new one, and add a new field. In the data type select from the drop-down Customer, as seen below.

0001-01

Once you do that, you can select the naming preference for the new relationships that are added. As seen in the screenshot below, new relationships are added to both the Account and Contact entities.

0001-02

Looking into the N:1 Relationships, you will find these new ones as seen below:

0001-03

With the field added to the form, we can now select either a Contact or an Account, as seen below:

0001-04

The Customer lookups that were already available on the following entities will remain the same, and function just as before:

  • Contract
  • Incident
  • Lead
  • Quote
  • Opportunity
  • SalesOrder

If you need to create this lookup programmatically, you can call new CreateCustomerRelationshipRequest message. For the technical details see the MSDN documentation available at:

https://msdn.microsoft.com/en-us/library/gg509035.aspx#BKMK_createcustlookup

For the class details see:

https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.messages.createcustomerrelationshipsrequest.aspx

Enjoy!

Advertisements