addErrorMessage()

addErrorMessage of the GlideSystem class can be used to add an error message to the current interactive user session. These session error messages are shown to end users at the top of the form and above any addInfoMessage entries.

Usage:

gs.addErrorMessage(Object message); 

Example:

gs.addErrorMessage("Incident record successfully updated."); 

Get ServiceNow Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.