Microsoft CRM 3.0 – Hide Links in Left Navigation – Example Code

AshokTechnical TipsLeave a Comment

Here is an example of code to get stripped down contact and account forms. This code is placed in the onLoad event of the respective forms. Note: this is not supported, but a common way to hide left navigation links on specific entities (since normal site map customization does not affect these). The other method we typically employ is to remove access from many users to some functions they will not touch (like Cases if an organization is not taking advantage of the Services components). However, this is a fail-safe way in cases where permissions do not control access or if a new group/permissions are issued and someone accidentally gets to see certain links the organization has already decided not to use.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/////////////////////////////////////////////////////////////////////
// Hide areas within navigation
var navQuotes;
var navOrders;
var navInvoices;
var navService;
var navContracts;
var navListsInSFA;
var navCampaignsInSFA;
var nav_NA_SFA;
var nav_NA_CS;
var nav_NA_MA;
 
navQuotes = document.all.navQuotes;
navOrders = document.all.navOrders;
navInvoices = document.all.navInvoices;
navService = document.all.navService;
navContracts = document.all.navContracts;
navListsInSFA = document.all.navListsInSFA;
navCampaignsInSFA = document.all.navCampaignsInSFA;
nav_NA_SFA = document.all._NA_SFA;
nav_NA_CS = document.all._NA_CS;
nav_NA_MA = document.all._NA_MA;
 
if (navInvoices != null) { navInvoices.style.display = “none”; }
if (navOrders != null) { navOrders.style.display = “none”; }
if (navQuotes != null) { navQuotes.style.display = “none”;}
if (navService != null) { navService.style.display = “none”;}
if (navContracts != null) { navContracts.style.display = “none”;}
if (navListsInSFA != null) { navListsInSFA.style.display = “none”;}
if (navCampaignsInSFA != null) { navCampaignsInSFA.style.display = “none”;}
if (nav_NA_SFA != null) { nav_NA_SFA.style.display = “none”;}
if (nav_NA_CS != null) { nav_NA_CS.style.display = “none”;}
if (nav_NA_MA != null) { nav_NA_MA.style.display = “none”;}
else {
alert(”Navigation not found”);
}

Leave a Reply

Your email address will not be published. Required fields are marked *