Microsoft CRM 3.0 custom entities vs. customising system entities

So Here It Is, Merry Christmas...

One of my team's CRM requirements is to track both customers and partners, which begs the question do I make use of the "Account" entity for both or do I create a custom entity for one (or both)? I decided to customise the "Account" entity rather than create new entities for the following reasons

  1. Parent and Child Account & Contact hierarchies provide rollup of information
  2. “Opportunities” can be customised with a variety of different processes (Sales Processes), such as product sales processes, partner development processes etc.
  3. “Relationships Roles” can be created between “Contact”, “Account” and “Opportunity” entities, to allow us to track which Partners are working on which Customer Opportunities.

This lead me to the next problem, how to customise the "Account" entity to show different information depending on whether we are looking at a Customer or a Partner. Although both share many common attributes (e.g. Address Details, Phone, Fax etc), we need to track information specific to Partners, such as their Microsoft Partner Program (MSPP) membership details and competency information. I created a new "MSPP" tab on the main form and added a number of attributes, but unfortunately there is no way in the SDK to show/hide tabs based upon the value of the "CustomerTypeCode" picklist field. A simple example would be:

  • If CustomerTypeCode == “Customer” then hide the MSPP tab
  • If CustomerTypeCode == “Partner” then show the MSPP tab (i.e. do nothing).

After reading through a number of articles, blogs & newsgroup postings, I stumbled upon a utility call the Internet Explorer Developer Toolbar. This is a great debugging tool which allows you to inspect all HTTP traffic to and from your browser. It makes wading through the individual HTML form elements to find a specific element id a piece of cake. Very quickly, I was able to find the CRM Tabs and saw that they have an id in the format “tabxTab”, where x is an integer value starting at zero.

So all I had to do was access the MSPP Tab object (id = tab1Tab) through the form OnLoad event, as shown below:

if (crmForm.all.customertypecode.SelectedText == "Customer")
{
    crmForm.all.tab1Tab.style.display="none";
}

One major caveat. Although unlikely, it is possible that this id may change without warning with the release of hotfixes, service packs or new versions of CRM. We are getting into the realms of “Unsupported Customisations”, where future updates may cause your code to fail. However as long as you don’t rely too heavily on this kind of technique, and you remember to test your customisations each time you apply hotfixes, services packs or new versions then you should be fine.

This posting is provided "AS IS" with no warranties, and confers no rights.