Infomessages on portal

Jan Brani_
Tera Expert

Where I can configure infomessage on portal, for example when new HR case is created, there are two infomessages, I need to change them little bit (trim surname and change link) but I have no idea where I could find them.

find_real_file.png

1 ACCEPTED SOLUTION

Paul Wydra III
Tera Expert

Hi Jan,



You can edit the "Created..." message by editing a Widget. The Widget you are seeking is called SC Catalog Item (widget-sc-cat-item). Clone that widget to begin making your changes.



The logic for generating the messages exists in the Client Script.



Edit the function at the bottom of the Client Script, called issueMessage(). This is what is called after the form has been submitted, and the order has been processed.


function issueMessage(n, table, sys_id) {


  var page = table == 'sc_request' ? 'sc_request' : 'ticket';


  var t = "${Created} " + n + " - ";


  t += "${track using 'Requests' in the header or}";


  t += ' <a href="?id=' + page + '&table=' + table + '&sys_id=' + sys_id + '">' + "${click here to view}" + '</a>';


  spUtil.addInfoMessage(t);


}


Once you have made the changes, simply replace the OOB Widget Instance that appears on the page "sc_cat_item", with your newly cloned one.



If you want to see where issueMessage() gets called, take a peek at the getOne() function for its use.



I am unsure where the "assigned to" message gets called from, but it is not in the Widget from what I can tell.




Thanks.


View solution in original post

17 REPLIES 17

rohantyagi
ServiceNow Employee
ServiceNow Employee

Not sure if there is an easy way, however you can try looking into some system logs: Viewing System Logs - ServiceNow Wiki


or try running on of these debugging tools, may be the client side debugging: Debugging Tools Best Practices - ServiceNow Wiki


Paul Wydra III
Tera Expert

Hi Jan,



You can edit the "Created..." message by editing a Widget. The Widget you are seeking is called SC Catalog Item (widget-sc-cat-item). Clone that widget to begin making your changes.



The logic for generating the messages exists in the Client Script.



Edit the function at the bottom of the Client Script, called issueMessage(). This is what is called after the form has been submitted, and the order has been processed.


function issueMessage(n, table, sys_id) {


  var page = table == 'sc_request' ? 'sc_request' : 'ticket';


  var t = "${Created} " + n + " - ";


  t += "${track using 'Requests' in the header or}";


  t += ' <a href="?id=' + page + '&table=' + table + '&sys_id=' + sys_id + '">' + "${click here to view}" + '</a>';


  spUtil.addInfoMessage(t);


}


Once you have made the changes, simply replace the OOB Widget Instance that appears on the page "sc_cat_item", with your newly cloned one.



If you want to see where issueMessage() gets called, take a peek at the getOne() function for its use.



I am unsure where the "assigned to" message gets called from, but it is not in the Widget from what I can tell.




Thanks.


Thank you Paul, thats it!


How to prevent confirmation messages( infomessages ) from disappearing after a few seconds. If we hoover over the message then it stays but I need to extend it for some more time before it gets disappeared.



Thanks in advance


Adrish


Hi adrish



Please let me know if you got any solution because I am also looking for the same