Scripting Alert, Info, and Error Messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2017 06:43 AM
Hi!
i was wondering if someone can help me to understand better what is the difference between gs.addMessage and gs.alert??
I want to use the gs.addMessage for the users, and the gs.alert for the admins.
Can i get a simply example to better understanding?
Thanks and Regards!
-Sergio V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2017 06:48 AM
Hi Sergio,
gs.addInfoMessage(') will display a banner at the top of the content frame displaying your message.
alert('Hello World') will make a new window pop up with your message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2022 03:19 PM
That's Great

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2017 06:49 AM
Hi Sergio,
gs.addMessage - would be running when record is saved. Considering a business rule that creates an project from demand to add the display the number of project created. It is server side.
alert - would run before form is saved. It is client side.
Link http://wiki.servicenow.com/index.php?title=Scripting_Alert,_Info,_and_Error_Messages#gsc.tab=0 explains it best.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2017 06:50 AM
Hi Sergio
Gs.addinfomessage will add a information message on top of the screen and it is used in server side scripting. Alert cannot be used on server side. it is used on the client side only.
Regards
harsh