Module Archives - ServiceNow Guru https://servicenowguru.com/tag/module/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 21:30:21 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 https://servicenowguru.com/wp-content/uploads/2024/05/cropped-SNGuru-Icon-32x32.png Module Archives - ServiceNow Guru https://servicenowguru.com/tag/module/ 32 32 Waiting Chat Queue Entries Notification https://servicenowguru.com/system-ui/waiting-chat-queue-entries-notification/ https://servicenowguru.com/system-ui/waiting-chat-queue-entries-notification/#comments Fri, 22 Jun 2012 18:03:32 +0000 https://servicenowguru.wpengine.com/?p=4486 Just the other day I came across an issue with a client that came up with a couple of users on the ServiceNow forums as well. The issue was that technicians monitoring a chat queue had no way of knowing that a chat was waiting unless they were staring at their chat desktop the entire

The post Waiting Chat Queue Entries Notification appeared first on ServiceNow Guru.

]]>
Just the other day I came across an issue with a client that came up with a couple of users on the ServiceNow forums as well. The issue was that technicians monitoring a chat queue had no way of knowing that a chat was waiting unless they were staring at their chat desktop the entire time. Since most IT people tend to multitask, this can become a problem resulting in longer-than-ideal wait times in the chat queue.
With the help of the ServiceNow Guru ‘Module Counts’ update set I was able to find a solution that I think effectively solves this issue by showing a count in the left navigation pane whenever a new chat enters a user’s queue.

Waiting Chat Queue Solution

1) Install the ServiceNow Guru ‘Module Counts’ update set

The ‘Module Counts’ update set is what makes this whole solution work. By installing the update set you can set up a module in your left navigator that updates automatically as new entries come into your chat queue. You can access the download directly from this link.

2) Configure the ‘Waiting Chats’ module

Once you’ve committed the ‘Module Counts’ update set you can create the module to display the number of waiting chat queue entries. I placed my module under the ‘Service Desk’ application and configured it as shown in the screenshot below…

Waiting Chats Module

The ‘Module Counts’ refresh interval’s lowest setting is 5 minutes. This is done to help ensure adequate performance of the solution. In this case however, it may make sense to personalize the choices for the ‘Refresh interval’ field in the screenshot above and add a 30 second interval (value of 30000 milliseconds) for use by this module.

3) Configure the ‘Waiting Chats’ list layout

Once the module is configured, you should see the ‘Waiting Chats’ record count displayed in next to the module in the left navigator. You’ll also want to personalize the list layout and list control to show the correct information. I changed the columns and removed the ‘New’ button. You can perform these actions by right-clicking the list header and selecting ‘Personalize’.

Waiting Chat List

4) Add a ‘Show Chat Desktop’ UI action to your list

Finally, you can add a context menu UI action for your list so that technicians can click into the module, right-click one of the entries, and open up the chat desktop directly from the list.

Show Chat Desktop

Here’s how I set up the UI action…

‘Show Chat Desktop’ UI action
Name: Show Chat Desktop
Table: Chat Queue Entry (chat_queue_entry)
Client: True
Form link: True
List context menu: True
onClick showChatDesktop();
Condition: current.action == ‘waiting’
Script:

// Show the chat desktop in a new window
function showChatDesktop() {
var url = 'chat_desktop.do?sysparm_nostack=true';
window.open(url, 'chat_desktop');
}

That’s it! Hopefully this solution gives you a better way to manage your chat queue going forward.

The post Waiting Chat Queue Entries Notification appeared first on ServiceNow Guru.

]]>
https://servicenowguru.com/system-ui/waiting-chat-queue-entries-notification/feed/ 34
Highlight Selected Navigation Module https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/ https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comments Wed, 14 Sep 2011 14:05:52 +0000 https://servicenowguru.wpengine.com/?p=4000 I received a client request last night asking if there was any way to provide some sort of additional highlighting to the currently-selected module in the left navigation. You’re probably already aware that when you click on a link in the left nav that link changes to a bold text. The client wanted to add

The post Highlight Selected Navigation Module appeared first on ServiceNow Guru.

]]>
I received a client request last night asking if there was any way to provide some sort of additional highlighting to the currently-selected module in the left navigation. You’re probably already aware that when you click on a link in the left nav that link changes to a bold text. The client wanted to add a background highlight color in addition to the bolded text so that the selected module would be easier to see. The end result of this customization looks something like this…


This customization obviously isn’t for everybody, but I think it does demonstrate a good use of UI scripts. The script below needs to be set up as a Global UI script so that it will run throughout the user session. Within the script I check to see if the navigation pane is being loaded or not so we can cut down on a lot of the unnecessary code when the main frame is loading content. If the script finds the navigation pane it attaches an event to each menu item. This event is triggered when the item is clicked and it adds the highlight color to that item. In addition, it removes the highlight color from the previously-selected menu item.

You can change the highlight color by modifying the ‘lightskyblue’ text below to whatever color you want!

‘AddNavMenuHighlight’ UI script
Name: AddNavMenuHighlight
Global: True
Description: Adds a highlight color to the background of the last-selected module in the left navigation.
Script:

var lastAppLinkColor;
var menuCheckCount = 0;

addLoadEvent( function() {
   //Attach an event to the click of any nav menu item
   var menuCheckInterval = setInterval(function(){checkMenu()},1000);
   function checkMenu(){
      try{
         if(window.frames[1]){
            var menuItems = window.frames[1].document.getElementsByTagName('a');
            if (menuItems.length != 0 || menuCheckCount > 10) {
               clearInterval(menuCheckInterval);
               setHighlight(menuItems);
            }
            else{
               menuCheckCount++;
            }
         }
      }catch(e){}
   }
   function setHighlight(menuItems){
      for (i=0; i < menuItems.length; i++) {
         if(menuItems[i].className == 'menu'){
            Event.observe(menuItems[i], 'click', function(event) {
               //Remove the highlight from the previously-highlighted menu item
               if (lastAppLinkColor) {
                  lastAppLinkColor.style.backgroundColor = "";
               }
               //Get the parent table row of the link clicked
               var elt = Event.findElement(event, 'div'); //If UI11 target 'tr' instead of 'div'
               if (elt != document) {
                  //Add the highlight color
                  $(elt).style.backgroundColor = "lightskyblue";
                  lastAppLinkColor = elt;
               }
            });
         }
      }
   }
});

The post Highlight Selected Navigation Module appeared first on ServiceNow Guru.

]]>
https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/feed/ 32
Expand/Collapse All Separator Modules at Once https://servicenowguru.com/system-ui/expand-collapse-separator-modules/ https://servicenowguru.com/system-ui/expand-collapse-separator-modules/#comments Tue, 17 May 2011 13:37:11 +0000 https://servicenowguru.wpengine.com/?p=3569 A few weeks ago I helped a co-worker with a requirement they had to allow users to easily collapse and expand all of the module separator sections under the ‘Configuration’ application in ServiceNow. The ‘Configuration’ application is loaded with modules for all of the CMDB classes in the system. While this may be useful for

The post Expand/Collapse All Separator Modules at Once appeared first on ServiceNow Guru.

]]>
A few weeks ago I helped a co-worker with a requirement they had to allow users to easily collapse and expand all of the module separator sections under the ‘Configuration’ application in ServiceNow. The ‘Configuration’ application is loaded with modules for all of the CMDB classes in the system. While this may be useful for admins, it can also be a lot to look at all at once under the application. Of course, you can expand and collapse the module sections to more easily display these modules but there are also about 12 of those to do! What the client wanted was to be able to click once and expand or collapse all of the module separators at once.

While this solution probably isn’t for everybody, it might save somebody some work down the road so I’ll post it here :).

Click here to see how you can add this same collapse/expand type of effect to other elements on your forms!

We were able to accomplish this by setting up an ‘HTML’ type of module under the application where we wanted the collapsible modules. Here are a couple of screenshots showing the end result for the ‘Configuration’ application…

Application Sections Expanded

Application Sections Collapsed



Here’s how you could set this up in your system for the ‘Configuration’ application. If you want to use this on other applications, simply replace all occurrences of ‘CMDB’ in the arguments below with a name that will be unique to the application that you set the module up for.

‘Collapse/Expand AppSections’ Module
Name: Collapse/Expand AppSections
Order: -20
Application: configuration_management
Link type: HTML (from Arguments)
Arguments:

<span  id="expand_appsection_CMDB" style="display: none; cursor: pointer; font-weight: bold;" onclick="collapseAppSections_CMDB(this);"><img src="images/icons/nav_collapseall.gifx"/>Collapse All Sections</span>
<span  id="collapse_appsection_CMDB" style="display: block; cursor: pointer; font-weight: bold;" onclick="expandAppSections_CMDB(this);"><img src="images/icons/nav_expandall.gifx"/>Expand All Sections</span>
 
<script>
function collapseAppSections_CMDB(el) {
   var items = el.up('.submenu').select('tr[id*=children.]').each(function(item){
      var itemEl = $(item.id.split('.')[1]);
      if(itemEl.getStyle('display') == 'block'){
         toggleSectionDisplay(itemEl.id,'arrow','');	
      }
   });
   $('collapse_appsection_CMDB').show();
   $('expand_appsection_CMDB').hide();
}

function expandAppSections_CMDB(el) {
   var items = el.up('.submenu').select('tr[id*=children.]').each(function(item){
      var itemEl = $(item.id.split('.')[1]);
      if(itemEl.getStyle('display') == 'none'){
         toggleSectionDisplay(itemEl.id,'arrow','');	
      }
   });
   $('expand_appsection_CMDB').show();
   $('collapse_appsection_CMDB').hide();
} 
</script>

The post Expand/Collapse All Separator Modules at Once appeared first on ServiceNow Guru.

]]>
https://servicenowguru.com/system-ui/expand-collapse-separator-modules/feed/ 1
Populating Default Values with a URL or Module https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/ https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comments Thu, 18 Mar 2010 14:18:28 +0000 https://servicenowguru.wpengine.com/?p=1212 A URL in ServiceNow is more than it seems at first glance. The various components of a URL actually contain quite a bit of information about what the system will do when that URL (or link) is used.  One way that you can leverage the ServiceNow URL structure is by using the ‘sysparm_query’ argument to

The post Populating Default Values with a URL or Module appeared first on ServiceNow Guru.

]]>
A URL in ServiceNow is more than it seems at first glance. The various components of a URL actually contain quite a bit of information about what the system will do when that URL (or link) is used.  One way that you can leverage the ServiceNow URL structure is by using the ‘sysparm_query’ argument to return a list of certain records.  You can also use ‘sysparm_query’ as a way of setting default values on a new record if necessary. This article shows you how.

This URL opens a new incident record with default values for ‘Active’, ‘Priority’, and ‘Short Description’.

https://demo.service-now.com/incident.do?sysparm_stack=incident.do&sys_id=-1&sysparm_query=active=true^priority=1^short_description=URL%20Default%20Value^EQ

Another place where you can apply the same concept is in module links in the left navigation pane. Since modules use the defined module parameters to create a URL, you can leverage the module filter and arguments to create ‘sysparm_query’ arguments in your module link. Simply create a module with a ‘Link Type’ of ‘New Record’ on whatever table you want and populate the ‘Filter’ field with the field/value pairs you want. This image shows how you could create a module to open a new incident record with default values for ‘Active’, ‘Priority’, and ‘Short Description’.


Module Default Value

The post Populating Default Values with a URL or Module appeared first on ServiceNow Guru.

]]>
https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/feed/ 10