gs.addInfoMessage() and gs.print() sometimes doesn't work at the same script? Please read the description

Ashirav
Tera Expert

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.

 

1 ACCEPTED SOLUTION

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.

View solution in original post

6 REPLIES 6

Thanks for replying. The thing is sometimes the logs aren't shown at all even in same external and internal conditions.

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.