Tuesday, April 24, 2007

Microsoft CRM 3.0 - Hiding Tabs and Fields

Sometimes there comes a need to hide fields and tabs in a CRM entity form (including System fields which we can't get rid of). You can't delete them during customisation because they have been locked. The attributes associated with these fields are Business Required, and cannot be modified. What can you do?

Rather than hiding a field at a time, we can hide the these fields by moving them into a "hidden" tab. Here's the trick to do this:
-In the OnLoad event of the form, insert the following code and enable the Event.

crmForm.all.tab4Tab.style.display="none";

Where "tab4Tab" is is the ID of the tab. The only thing you need to change is the integer. The number corresponds to the order of the tab. The order number begins with a 0.

Make sure the OnLoad Event has been enabled, and make sure you test the code in preview mode before publishing the changes. Keep in mind that there are limitations to this approach, as only eight tabs are allowed at most in each form.

No comments: