gs.log doesnt work on client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2017 08:00 PM
Hi all,
I have a very basic question. gs.log doesnt work on client scripts. I am using lot of alert to debug.. what are the alternatives ?
I know i can create ajax methods to create those logs.. but is there a simpler way???
~ Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 02:24 AM
Hi Kamlesh,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 12:56 AM
Hi Kamlesh,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 02:18 AM
Full list for anyone else seeking answer to the same question:
Scripting Alert, Info, and Error Messages - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 01:52 AM
Hi Kamlesh,
Good Day
Please find the below details for your references:-
The following are one which works at server side and its functions:-
- gs.log("test");writes to the database and the log file
- gs.print("test"); writes to the text log on the file system but not to the sys_log table in the database
- gs.addInfoMessage("test")it displays "test" on the top of the screen
The following are one which works at Client scripting and its functions:-
- alert("test") — it pop up a window with "test" and an Ok button.
- confirm("test") it pop up a window with "test" and along with Ok & Cancel button.
- To show an error message in specific field g_form.showErrorBox('YOUR FIELD NAME','test');
- To hide an error box which is visible in specific field, g_form.hideErrorBox('YOUR FIELD NAME');
gs.log() which you have mentioned in your script won't works since it will run only in server side not at client end.
Please mark it as helpful/correct based on the impact.
Thanks,
Priyanka R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 11:08 PM
Thanks, PriyaRanji