Pages

Wednesday 13 December 2017

{Know-How} MSCRM JS - show or hide Navigation items using display name or Label



Code Snippet to show or hide a navigation using display name

Function to show or hide Navs
ToggleNavigationItem = function (navName,isVisible) {
    var navs = Xrm.Page.ui.navigation.items.get();
    for (var i in navs) {
        var nav = navs[i];
        if (nav.getLabel() === navName) {
            nav.setVisible(isVisible);
        }
    }
};

Usage
ToggleNavigationItem("Accounts",false); //Hide
ToggleNavigationItem("Accounts",true); //Show

Note: The labels are case sensitive

3 comments:

  1. Amazing Article Written. I am very much glad to read your article.
    I am Following Your From Last 6 Month and really linking the stuff
    you post on your blog on Regular Basis.
    Keep Posting blogs like this….. Thanks alot

    also we provide WhatsApp API Integration Services. if any thing you need then please visit us https://umstechlabs.com/use-cases/whatsapp-integration-crm/

    ReplyDelete
  2. I read your article n blog
    My vote goes to your article
    kepp it up
    do work like this
    we provide service WhatsApp API Integration With Tally

    ReplyDelete