
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 08:27 AM
We have recently tweaked the contextual search widget so it appears on a 'Catalog Item' alongside a record producer - from this article: How to enable contextual search for a catalog item
On the record producer, everything is fine, but on the catalog item - where it suggests other catalog items, the order button has no text (see screen shot - button highlighted yellow with not text). I have gone through the various config screens, and even the widgets, but cant put my finger on how this text is set. (Ideally it should say Order or Request).
Any help massively appreciated 🙂
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Catalog
- 1,306 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 02:04 AM
All above did not fixed this problem for me unfortunately.
What i end up doing is changing the code in the cxs-result-catalog template by just hard coding the button text. I know this is not the best option but it works for me.
You can this by opening the cxs-result-catalog template : <instance_url>/nav_to.do?uri=%2Fsp_ng_template.do%3Fsys_id%3D503c0ed2d7203200f2d224837e6103b1%26sysparm_view%3D%26sysparm_domain%3Dnull%26sysparm_domain_scope%3Dnull%26sysparm_record_row%3D6%26sysparm_record_rows%3D15%26sysparm_record_list%3Dsp_widget%253db001d945d7a43200f2d224837e6103d0
Change line: <a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>{{orderActionDetails(result).actionLabel}}</a>
By adding your button text of choice before </a> at the end like so:
<a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>{{orderActionDetails(result).actionLabel}}Request</a>
Hope this helps.
Regards,
Stefan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 01:11 AM
Hi,
The same problem is discussed here: https://community.servicenow.com/community?id=community_question&sys_id=8e79f8c3db15cd10679499ead3961961
And possible work around: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1000915
Hope this helps.
Regards,
Stefan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 02:04 AM
All above did not fixed this problem for me unfortunately.
What i end up doing is changing the code in the cxs-result-catalog template by just hard coding the button text. I know this is not the best option but it works for me.
You can this by opening the cxs-result-catalog template : <instance_url>/nav_to.do?uri=%2Fsp_ng_template.do%3Fsys_id%3D503c0ed2d7203200f2d224837e6103b1%26sysparm_view%3D%26sysparm_domain%3Dnull%26sysparm_domain_scope%3Dnull%26sysparm_record_row%3D6%26sysparm_record_rows%3D15%26sysparm_record_list%3Dsp_widget%253db001d945d7a43200f2d224837e6103d0
Change line: <a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>{{orderActionDetails(result).actionLabel}}</a>
By adding your button text of choice before </a> at the end like so:
<a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>{{orderActionDetails(result).actionLabel}}Request</a>
Hope this helps.
Regards,
Stefan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 01:03 AM
Nice one, i had ended up editing this record manually in the end anyway.
Just one tweak - in the updated code line, i removed the '{{orderActionDetails(result).actionLabel}}' so the text displayed was only the Hardcode Text. (Otherwise, the same widget from a 'Incident' based support form, correctly displayed 'Order' or 'Request' and then the hard coded text.
<a class="btn btn-default sc-btn" ng-href="{{result.related_links[0].sp_link+'&referrer=contextual_search'}}" ng-attr-aria-label='{{i18n.format(c.data.i18nMsgs.catalog.order, result.title)}}'>Request</a>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2022 09:00 AM
I wish I'd found this thread earlier. This problem drove me crazy. Eventually SN Support linked me to the Problem record PRB1545548, and seeing the root cause I found another solution.
I wanted to keep the Widget and Angular ng-templates out-of-box, since ServiceNow is constantly making improvements to portal layout and accessibility and it's less diffing to do on an upgrade, so I looked for an upstream source.
Realizing that the Search Action Configurations are automatically created when you set up a Record Producer CXS Config, and they automatically set "Show on new record" to false, and that this field cannot be edited due to ACLs, but that the OOB "Create Incident" one has those all set to true, I looked at the code that creates the Search Action Configurations. I ended up modifying the Script Include "cxs_UIActionConfig" at instaneUrl/sys_script_include.do?sys_id=398646d587012300416e66d107cb0ba3 to change this (at like 26):
SHOW_ON_NEW_CONFIG: {
"platform": ["order", "this_helped", "full_view"],
"workspace": ["order", "flag", "full_view"],
"rp": []
},
to this:
SHOW_ON_NEW_CONFIG: {
"platform": ["order", "this_helped", "full_view"],
"workspace": ["order", "flag", "full_view"],
// hack for SNC HI PRB1545548:
"rp": ["order", "this_helped"]
},
Now when you create a Record Producer CXS Config, it will automatically set "Show on new record" to TRUE. You can update the old Record Producer CXS Configs by changing their Search Context to one with no Search Actions (such as "Response Templates") and then changing it back.
However, this did not completely solve the problem. While now MOST of my Catalog Items properly showed the "Order" button, any Catalog Items with a Request Method set to Request or Submit still showed the order button with no text (and did not show the Order button at all in the details header). I compared again to the Create Incident producer on an OOB PDI and found one other difference. By default when the Search Action Configuration for "Order" is generated, it has "Scripted Visibility" checked with the following UI Action visibility script:
visible = (resource.getValue('request_method') !== 'submit') && (resource.getValue('request_method') !== 'request');
So by default it's filtering out the Order button for Request Methods "Submit" and "Request". I have no idea why you would want to do that - a Request or Submit catalog item can still very much be a solution in incident deflection. I un-checked "Scripted Visibility" and now the Order buttons show everywhere they should!
Hope this helps anyone having this issue!