logo

NJP

JKMB Environment Marker

Import · Oct 20, 2021 · article

Servicenow Application

Jkmb.eu | JKMB Ltd.

Disclaimer

We developed this application for our own internal use but why not share it with everyone else? Hopefully, some of you might find it useful. image The application can be found on the Servicenow developer share.

*Use at your own risk and feel free to fix, change, rebuild anything you want.

Description

The application's purpose is to conveniently mark the environment which you are currently on so you are always on the right place when making changes. A common practice while working with ServiceNow is that developers or administrators will have several tabs open and some of them might be on different ServiceNow instances. When you have several tasks at hand you might accidentally make a change on the wrong environment if you have the wrong tab open by mistake.

This simple application is designed to help developers and administrators work with peace of mind and avoid mistakes. A cool environment marker will be placed on the screen, so you always notice where you are and avoid mistakes.

image

Specifications

Our environment marker is very easy to configure and users have total control over it. Everyone can decide for himself what look he wants and what position on the screen he wants. We developed our application with modern UX patterns in mind and we followed all best practices when coding it so you are safe when moving into the future. Sure we didn’t forget to take care for backwards compatibility so we support UI15 too.

Key advantages:

  • Easy installation and configuration.
  • Granular access control for more convinience.
  • image
  • Total control over look and feel.
  • image
  • Clean, easy to read and safe code.
  • image
  • Pure JS and CSS with zero dependencies (not even jQuery).
  • image
  • Proper error handling.
  • image
  • Seamless integration with UI16/UI15.
  • image
  • image

Installation

Just import it. That’s it. It consists only of 5 objects! Our implementation is made with simplicity in mind and we made sure to create our application part unique so we don’t interfere with anything on the system.

Access configuration

The access is controlled with three elements:

  1. Roles: env_marker_admin and env_marker_user
  2. System Property: jkmb_env_marker_main_switch

If you will be administering the functionality you need to add the two roles to your user.

The env_marker_user role gives you permission to use the functionality (if the main switch is on) so you will get a nice button in ServiceNow header:

image

The env_marker_admin role gives you permissions to edit the jkmb_env_marker_main_switch which as the names suggests is the main switch. With this property you can globally disable or enable the functionality. If you set it to false the functionality will be turned off for everyone no matter if they have the user role.

jkmb_env_marker_main_switch = true

image

jkmb_env_marker_main_switch = false

image

MARKER USAGE

The marker usage is done through a nice popup with all the settings inside:

image

Unlike the global on/off switch this option controls if you will have the environment marker shown on your screen or not.

image

image

We can place our marker on the for corners of the screen so this option takes care of this.

image

image

image

image

Controls the background color of the marker.

imageimage

imageimage

Controls the transparency of the marker.

imageimage

imageimage

It adjusts the size of the text in the marker.

imageimage

imageimage

View original source

https://www.servicenow.com/community/developer-articles/jkmb-environment-marker/ta-p/2316035