- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2021 04:32 PM
we have methods gs.getErrorMessage() and gs.getInfoMessage().
Where we use these methods and how to use these methods. what it gives the output. Pls explain...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2021 09:58 PM
Hello Prasanthi,
The scoped GlideSystem (referred to by the variable name 'gs' in any server-side JavaScript) API provides a number of convenient methods to get information about the system, the current logged-in user, etc.
So, you can use it in Server Script like Business Rules, Script Include, etc.
1) gs.getErrorMessage() is used to Returns the list of error messages for the session that were added by addErrorMessage().
2) gs.getInfoMessage() is used to Retrieves the list of info messages for the session that were added by addInfoMessage().
For more details you can refer below link: gs.getErrorMessage and gs.getInfoMessage()
I hope this will help you.
Mark ✅ Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks & Regards
Tejas Tamboli
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2021 05:35 PM
Hi Prasanthi,
'gs' is GlideSystem API from ServiceNow. It is a Server side API which means that you can use it in Business Rules, Server Script of Widgets etc.
The above mentioned method - gs.getErrorMessage() is used to display list of error message for the session that were rendered by gs.addErrorMessage().
You can see more details here - GlideSystem
Cheers,
Sam
Mark this response as correct if that really helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2021 09:58 PM
Hello Prasanthi,
The scoped GlideSystem (referred to by the variable name 'gs' in any server-side JavaScript) API provides a number of convenient methods to get information about the system, the current logged-in user, etc.
So, you can use it in Server Script like Business Rules, Script Include, etc.
1) gs.getErrorMessage() is used to Returns the list of error messages for the session that were added by addErrorMessage().
2) gs.getInfoMessage() is used to Retrieves the list of info messages for the session that were added by addInfoMessage().
For more details you can refer below link: gs.getErrorMessage and gs.getInfoMessage()
I hope this will help you.
Mark ✅ Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks & Regards
Tejas Tamboli

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2021 10:08 PM