Monday, June 13, 2011

CRM Custom entities with auto-populated Full Name field

While there are multiple system entities such as contact and user which have an auto-populated full name field, there is no simple way to extend that functionality to custom entities. The auto-populated full name field consists on a field that is maintained by the system and the value comes from a combination of the first, middle and last name field, as well as from the system settings on how to format full names (e.g. “Gonzalo Ruiz” vs. “Ruiz, Gonzalo”). For custom entities, you could have a custom fullname field which contains the entire name instead of separating the name into 3 fields (first, middle, last), but you would be missing on the following advantages:
  • Sort/search by first, middle or last name while still showing full name in views, lookups, reports.
  • Enforcing a consistent full name format across the organization.
Because of the previous limitations, I have created a solution that allows you to extend the “Full Name feature” to custom entities.  The solution is uploaded to CodePlex and supports:
  • Creating a full name primary field for any custom entity.
  • Auto-populate the full name according to the full name format selected in the organization system settings.
  • Auto-populate the full name from custom first, middle and last name fields.
  • CRM 2011 Online, OnPremises, IFD.

To see the full instructions on how the solution works, you can download the documentation here.
To see the source code and CodePlex project click here.
 
 
This is a preview of how your custom entity would look like after you create the custom full name field:
As with the contact entity, you enter the first, middle and last name information in different fields and the system populates the full-name field which is then shown in the form header and lookups.

No comments:

Post a Comment