- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 06:50 AM
gs.addInfoMessage(gs.getMessage("New User Created: {0}", current.caller_id.getDisplayValue()));
I have used this statement on a 'Before' Insert and Update Business Rule. When the page is to be submitted this runs. While testing I noticed sometimes sometimes it worked and sometimes it didnt work?
Same with gs.print() function.
Any specific reason? Is this normal to happen? Has it ever happened before?
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 02:43 AM
Hi,
if you use gs.info("test"), then it will be visible every time this script is called.
if you use gs.addInfoMessage, hen this will be visible only when you are on the screen from where this script is executed.
if you are using gs.info or gs.log with the dynamic value, then if the dynamic value is null, then you might not see the information.
Hence it is advisable to add the log with the static text along with dynamic something like below
gs.info("Testing value"+yourval);
Also, check if the gs.info log exists in any condition. Maybe the script or block of code is not being executed everytime.
Mark comment as correct and helpful if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 06:55 AM
Typically you would only see gs.print display if you were running as a background script where you could actually see the feedback from the script being run. However, if you actually download the log file (System Logs > Node Log File Download) you would be able to see the results of gs.print statements there as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 07:10 AM
Thanks for replying Nitesh.
I use "Debug Log" in Left navigator to view the logs using the gs.print() option. Sometimes the value is displayed, sometimes it isn't.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 07:14 AM
I am not quite sure where you're running this, now it might not display anything may be because it has nothing to display, may be nothing is returning from the script. It depends on the script you're trying to execute.
If you for example randomly say gs.print("blah blah blah"); it must display every single time. But if the script is returning something then it depends on other factors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 11:21 PM
Just use this.
gs.addInfoMessage("New User Created: {0}"+ current.caller_id.getDisplayValue());