Scripting Alert, Info, and Error Messages

svizcaino
Kilo Contributor

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.

8 REPLIES 8

Dubz
Mega Sage

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.


Adilson
Tera Contributor

That's Great

Jaspal Singh
Mega Patron
Mega Patron

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.


HarshTimes
Tera Guru

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