- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 08:35 AM
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
Any help greatly appreciated!
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 09:11 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 09:11 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 09:25 AM
I've been looking at the code for this widget, and I see how the message is created in the server script (image attached), but I don't see where this message is being triggered. There's no spUtil.addInfoMessage() displaying the message in this widget. My guess is they're somehow broadcasting an event to the rootScope and the message is being triggered somewhere else...
I'll keep looking but let me know if this helps.
- Dylan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 10:07 AM
I was looking at the sc catalog item v2 widget, which is why I couldn't see the addInfoMessage() method. Sorry about that!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 09:47 AM
thanks for the responses
I've added attempted Nathan's suggestion - I've added a true/false field on the sc_cat_item table called "u_show_message"
I've adjusted this section of the server script of the widget but I think I'm "including it in the catalog item object" incorrectly...
data.sc_cat_item = $sp.getCatalogItem(data.sys_id, true);
if (data.sc_cat_item.category) {
var categoryGR = new GlideRecord('sc_category');
categoryGR.get(data.sc_cat_item.category);
data.category = {
name: categoryGR.getDisplayValue('title'),
url: '?id=sc_category&sys_id=' + categoryGR.sys_id
}
}
data.hideMessages = data.sc_cat_item.u_show_message;
and in the client controller I've wrapped the sp_util like so
if (data.hideMessages == false) {
spUtil.addInfoMessage(t);
}
I've tried === and == just in case (I know elsewhere on the platform true/false evaluate unexpectedly...
submissions submit and generate REQ/RITMS properly but the "submitting" never resolves