Monthly Archives: November 2012

CRM 2011 Expand or collapse a tab

Here’s a javascript for expanding or collapsing a tab in a form in CRM 2011.

function ExpandTab(tabName, expand)
{
  var state  = ‘expanded’;
  if (!expand)
    state = ‘collapsed’;

  var tab = Xrm.Page.ui.tabs.get(tabName)
  if (tab != null)
    tab.setDisplayState(state)
  else
    alert(‘Missing tab ‘ +  tabName);
}

Advertisements