Quantcast
Channel: Fruition Partners – ServiceNow Global Strategic Partner
Viewing all articles
Browse latest Browse all 250

Add a new menu item in ServiceNow’s header profile dropdown

$
0
0

One of the strengths of ServiceNow is its flexibility and the customization capability it offers. In this Tips & Tricks article you will learn one of the many ways ServiceNow can be adapted to your user needs.

Imagine the following situation:
You would like to add a new menu item in the profile dropdown which is in the header (for example to add a toggle switch between the normal interface and the service portal/CMS).

Add a new menu item ServiceNow

The idea behind this is to tailor the navigation options to make it faster for your users to access what they need. This can be achieved by implementing a global UI script with the following code in it:

addLoadEvent(function(){
      Try{
             var addItem = (window.top.$j(“#custom_menu_item_1”).length == 0);
              if (g_user.hasRoles() && addItem) {
                  //Replace ‘onclick’ by ‘href’ with the suffix of the portal
                  var menuItem = “<li><a id=’custom_menu_item_1′ onclick=’alert(\”Will switch to
                  portal\”)’>” + getMessage(“Switch to Portal”) + “</a></li>”;
                  var menuList = window.top.$j(“ul.dropdown-menu”);
                  if(menuList.length > 0){
                      menuList.append(menuItem);
                  }
              }
      }catch(e){
           //Uncomment for debugging
         //alert(e);
     }
});

The post Add a new menu item in ServiceNow’s header profile dropdown appeared first on Fruition Partners - ServiceNow Global Strategic Partner.


Viewing all articles
Browse latest Browse all 250

Trending Articles