Stop addInfoMessage Displaying twice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2016 09:04 AM
Hello,
I am using a BR script in Test Management module to update test case Execution status based on Child test status. But the addInfoMessage displays twice. How to stop it
Tried this script running in Before and After scripts couldn't fix it:
Running the script in-- test case[tm_test_case_instance] table
var sysid = current.sys_id;
var ctest = new GlideRecord("tm_test_instance"); // test table
ctest.addEncodedQuery('execution_status!=passed^tm_test_case_instance='+sysid);
ctest.query();
if (ctest.getRowCount()==0)
{
gs.addInfoMessage("passed");
}
How to fix this, anything wrong with the script?
Thanks,
Alad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 12:47 AM
Hi,
Please check if you have any Business Rule which is running on "Before" and containing current.update().
PS: Hit answered, like, Helpful or Correct depending on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 04:24 AM
Hi Anupama,
Checked all the Business rule in that table [tm_test_case_instance]. No Business Rule which is running on "Before" and containing current.update(). I have checked this in a new instance by enabling the test management module and running the script, still the same behavior. Don't know whats going wrong.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 04:30 PM
I've come across this issue pre-Geneva and done the same debug, just to find that the business rule is only shown as being run once, yet the info message *sometimes* shows twice.
Try this without any logic and just an addInfoMessage on it's own and you will find it still shows twice.
I would log this to HI.
As a workaround, you could set a scratchpad variable in your display business rule and check for it in an onLoad client script, which would then use g_form.addInfoMessage.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022