Friday, 12 October 2012

hide navigation links in crm 2011 using javascript


I had a requirement to control visibility of navigation link on some condition. I added onload function and from that function called following function.

function SetDocumentationVisbitlity(navigationlabel, visibility) { 

         var items = Xrm.Page.ui.navigation.items.get();
         for (var i in items) {
               var item = items[i];
               if (item.getLabel() == navigationLabel) {
                   item.setVisible(visibility);
               }
         }
}

No comments:

Post a Comment