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.
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.
Looking into the N:1 Relationships, you will find these new ones as seen below:
With the field added to the form, we can now select either a Contact or an Account, as seen below:
The Customer lookups that were already available on the following entities will remain the same, and function just as before:
If you need to create this lookup programmatically, you can call new CreateCustomerRelationshipRequest message. For the technical details see the MSDN documentation available at:
For the class details see: