How to find the source of an empty gs.addInfoMessage()?

Michele11
Tera Contributor

Hi,

I manage a custom service portal created by a previous developer.
I have discovered that the portal page loaded after submitting any catalog item shows a gs.addInfoMessage() box with no text.

Some more info:

1) There is always at least one message, but in some catalog items there are more.
2) The number of messages for some unknown reason seems to be influenced by the number of workflow activities in the workflow that is triggered by the submit
3) The messages only appear the first time the page is loaded after the submit. When the portal page is refreshed, the messages do not appear anymore.
4) Messages are always empty

The following picture is what it looks like:

find_real_file.png

 

and this is the HTML for the part of the page hosting the messages:

<div id="uiNotificationContainer" role="status" aria-atomic="false">
   <!-- ngRepeat: m in c.notifications -->
   <div ng-repeat="m in c.notifications" class="alert ng-scope alert-success" ng-class="{'alert-danger' : m.type == 'error', 'alert-warning' : m.type == 'warning', 'alert-success' : m.type != 'warning' &amp;&amp; m.type != 'error'}" style="">
      <!-- ngIf: m.type == 'error' --><!-- ngIf: m.type == 'error' --><span class="alert-msg ng-binding" ng-bind-html="m.displayMessage" ng-click="::c.dismissOnAnchorClick($event)" role="presentation">&nbsp;</span><button class="btn btn-link fa fa-close dismiss-notifications" ng-click="::c.dismissNotification($index)" aria-label="Close Notification"></button>
   </div>
   <!-- end ngRepeat: m in c.notifications -->
   <div ng-repeat="m in c.notifications" class="alert ng-scope alert-success" ng-class="{'alert-danger' : m.type == 'error', 'alert-warning' : m.type == 'warning', 'alert-success' : m.type != 'warning' &amp;&amp; m.type != 'error'}" style="">
      <!-- ngIf: m.type == 'error' --><!-- ngIf: m.type == 'error' --><span class="alert-msg ng-binding" ng-bind-html="m.displayMessage" ng-click="::c.dismissOnAnchorClick($event)" role="presentation">&nbsp;</span><button class="btn btn-link fa fa-close dismiss-notifications" ng-click="::c.dismissNotification($index)" aria-label="Close Notification"></button>
   </div>
   <!-- end ngRepeat: m in c.notifications -->
   <div ng-repeat="m in c.notifications" class="alert ng-scope alert-success" ng-class="{'alert-danger' : m.type == 'error', 'alert-warning' : m.type == 'warning', 'alert-success' : m.type != 'warning' &amp;&amp; m.type != 'error'}" style="">
      <!-- ngIf: m.type == 'error' --><!-- ngIf: m.type == 'error' --><span class="alert-msg ng-binding" ng-bind-html="m.displayMessage" ng-click="::c.dismissOnAnchorClick($event)" role="presentation">&nbsp;</span><button class="btn btn-link fa fa-close dismiss-notifications" ng-click="::c.dismissNotification($index)" aria-label="Close Notification"></button>
   </div>
   <!-- end ngRepeat: m in c.notifications -->
</div>

 

I have tried to find gs.addInfoMessages() of any kind in the widget that make up the page, but to no avail. I have also tried looking for the message box in the sys_metadata table, but the fact there is no text in the messages does not make it feasible to filter results efficiently.

 

Is there any way for me to find the source of the message box?

 

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

You can check for table in which record is inserted. Since, you say its during submit then possible options can be

1. Insert business rule or script include that might be called in business rule executing during insert

2. Server side script of the widget

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Michele,

There's a debug option ("System Diagnostics" > "Session Debug" > "Enable All") which will log what is executed. Enabling may offer a clue to where the message is being outputted.

https://docs.servicenow.com/en-US/bundle/sandiego-application-development/page/script/debugging/conc...

Nathan Okh
Mega Sage

Finally someone else having the same issue as myself. Its quite the riddle, and annoying.

Did you find the culprit?

 

I tried what these above fellows did with no avail...

 

HELP!!

It appeared that it was being generated by a widget that was included in the page being viewed. I could not find out what was generating the messages, so I checked the css for the info messages and hid them in the page CSS with display:none by default. This way, even if the widget somehow generated them, they would at the very least remain invisible to the user.