Thursday, November 17, 2011

Hide Section in CRM 2011

Do you want to hide a section in CRM 2011?

Steps

1. Open the customization form
2. Double click the section and copy the section Label. Let's say it's name is 'General'
3. Copy the below java script function
function HideSection(sectionLabel)
{
   try
   {
       var tabs = Xrm.Page.ui.tabs;
       for (var i = 0; i < tabs.getLength(); i++)
       {
           var tab = tabs.get(i);
           var sections = tab.sections;
           for (var j = 0; j < sections.getLength(); j++)
           {
               var section = sections.get(j);
               if (section.getLabel() == sectionLabel)
               {
                   section.setVisible(false);
                   break;
               }
           }
       }
   }
   catch (err)
   {
   }
}

4. Call the function in CRM Form Load event
HideSection('General');

No comments:

Post a Comment