Tuesday, September 19, 2006

MSCRM 3.0 Client: Hiding Tab, Menu Item and Button

To hide a Tab, find out the Tab Element ID, and attach codes below to form OnLoad event:
try 
{
    var objElement = document.getElementById("tab3Tab");
    objElement.style.display = 'none';
} 
catch(ERR) {}

To hide a Menu Item or Button, find out the Element ID, and attach codes below to form OnLoad event:
try 
{
    // Hiding "Recalculate" Menu Item
    var objElement = document.getElementById("_MIcrmFormSubmitCrmForm1truetruefalse");
    objElement.style.display = 'none';
} 
catch(ERR) {}
try { // Hiding "Recalculate" Button var objElement = document.getElementById("_MBcrmFormSubmitCrmForm1truetruefalse"); objElement.style.display = 'none'; } catch(ERR) {}


Usually Menu Item will be prefixed with _MI... and button will be prefixed with _MB...

The same method can be used to hide an item from the left Navigation Pane.