Book Image

Learning ServiceNow

By : Sylvain Hauser
Book Image

Learning ServiceNow

By: Sylvain Hauser

Overview of this book

This book shows you how to put important ServiceNow features to work in the real world. We will introduce key concepts and examples on managing and automating IT services, and help you build a solid foundation towards this new approach. We’ll demonstrate how to effectively implement various system configurations within ServiceNow. We’ll show you how to configure and administer your instance, and then move on to building strong user interfaces and creating powerful workflows. We also cover other key elements of ServiceNow, such as alerts and notifications, security, reporting, and custom development. You will learn how to improve your business’ workflow, processes, and operational efficiency. By the end of this book, you will be able to successfully configure and manage ServiceNow within your organization.
Table of Contents (21 chapters)
Learning ServiceNow
Credits
About the Author
About the Reviewer
www.packtpub.com
Customer Feedback
Preface

GlideSystem


The GlideSystem server-side API is available to all server-side scripts via the variable gs. This API allows us to get various kinds of useful information about the system, the user's session, the current date/time, or other bits of useful info. It also allows you to interact with the user, by displaying informational or error messages.

addErrorMessage() and addInfoMessage()

The addErrorMessage() method will display a red error message at the top of the user's browser window on the next page they load after the server-side script that calls this method runs. This same functionality can also be achieved from a client-script, using the g_form API (g_form.addErrorMessage()).

addInfoMessage() has the same effect, but instead displays a blue informational message as opposed to a red error message.

Example usage

The following script could run inside of a business rule, and show a message indicating whether the operation was allowed or not:

if (current.active.changesFrom(false)) { 
  ...