The CreatorCon Call for Content is officially open! Get started here.

Service Portal Submission Messages

arabeau
Kilo Contributor

Hey All,

looking for some help on how to remove the "Created REQ" message for certain catalog items

We have a requirement to not display this message when a certain catalog item is submitted - I've messed around with a modified SC CATALOG ITEM widget but I just keep breaking it

find_real_file.png

Any help greatly appreciated!

 

1 ACCEPTED SOLUTION

nathanfirth
Tera Guru

I would add a field to the catalog item record, include it in the catalog item object in the server script of the widget. And then in the controller where it calls spUtil.addInfoMessage(), wrap it in an IF condition to determine whether to trigger the notification or not.

Should be pretty straightforward to implement.

Hope that helps.

-----------------
Nathan Firth
Founder and ServiceNow Architect
NewRocket, Inc.
nathan.firth@newrocket.com
http://serviceportal.io
http://newrocket.com

View solution in original post

6 REPLIES 6

In your condition you need to use the controller object, it'd look like this:

 if (c.data.hideMessages == false) {
   spUtil.addInfoMessage(t);
  }

thanks Dylan, that helped resolve the "submitting...." issue

thanks Nathan as well - I got it working -

 

- for anyone else looking..

Server Script  

var msgGR = new GlideRecord('sc_cat_item');
 msgGR.get(data.sys_id);
 if (msgGR.u_show_message == true) {
  data.hideMessages = false;
 } else data.hideMessages = true;

 

client controller just as Dylan said

  if (c.data.hideMessages) {
   spUtil.addInfoMessage(t);
  }