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

Hi Adrish,



Are you wanting the message to be displayed for longer or redirect to the submitted form?


Hi Matthew,



My requirement is the message to be displayed for longer time. It is working displaying longer sometimes but sometimes it disappears quickly.


I want that message to stay for some more time


Hi Paul,

Now that we are in Madrid, the above script has been completely redone. 

I can see the getOne() function, but the issueMessage() function has been replaced with some functions. I used the OOTB widget, but could not get the inoMessage when I submitted any request.

Could you help?

THanks

mattsaario
Giga Contributor

Hi Jan,



Have a look at the page (in designer/page editor) where the request is on and take a look at what widget it uses.



Now open the widget and take a look in the Client Controller code for something along the lines of:



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);


  }



This section of code generates the message that appears after you submit the request/order....



You will need to clone the OOB widget before you can edit it.



Let me know if you need some further help.



Cheers,


Matt