Microsoft Dynamics CRM - Hiding Navigational Menu Item
To hide a navigational menu in CRM, we need to add some java script in the form onload() event. Let’s say, we want to hide the "View More Addresses" navigational menu item from Accounts. Now, we have to know the Element ID of that menu item. The question is: Where to find the ID? If it was a custom designed form, we could go to the design mode and get the ID of every object of the form. But, being the default CRM form, we can easily find it from “View Source” mode.
But, by default CRM doesn’t allow to get the context menu or IE with default toolbar/menu item. The context menu can be enabled by altering Global.js file which I will discuss in the later part of this document.
To get the IE menu/Toolbar, we have to play a little trick here. Press Cntrl+N to open the page in IE toolbar mode and then click on Page->View Source. Then perform a text search on the label of that navigational item. In this case, we searched for "View More Addresses" and found the id="navAddresses". So, I am going to create a generic java script function HideNavMenu to hide the elements from a form and then call that function to hide the "View More Addresses” navigational menu item.
HideMenuItem('navAddresses’);
function HideNavMenu(itemName)
{
if (document.getElementById(itemName) != undefined) {
document.getElementById(itemName).style.display = 'none';
}
}
Comments
Post a Comment