How to hide attachment icon of catalog item in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 06:00 AM
I want to hide attachment icon for specific catalog item in "Service Portal" view.
Note: I am able to hide on normal catalog item view but not in "Service Portal" The code which i have written is working on catalog item view but its not
working on "Service Portal" view even i have used "UI Type = Bothe" in client script.
Please suggest.
Regards,
Sumit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2019 06:34 AM
I'm trying to solve for the same issue. I haven't tried it yet, but I'm thinking about cloning the widget, adding an item to the options schema, and then using ng-if to evaluate whether the option is true or not. In the body of the widget HTML, I think I can do something like this to hide the add attachments link based on the option:
<div class="wrapper-md row no-margin" ng-if="c.options.show_add_attachments === 'true'">
<now-attachments-list template="sp_attachment_single_line" ></now-attachments-list>
<label ng-if="!submitting" style="float:right;font-weight:normal;cursor:pointer;">
<sp-attachment-button></sp-attachment-button>
<span style="padding-left:4px;">${Add attachments}</span>
</label>
</div>
I'll let you know how it goes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2019 07:07 AM
Hi There,
In Madrid there's a checkbox "Hide attachment" [no_attachment_v2].
Untill then, you can use some manipulation (not recommended, though does work on Service Portal):
Create a new Catalog Client Script
Type: onLoad
function onLoad() {
var attachmentButton = top.document.getElementsByTagName('sp-attachment-button');
attachmentButton[0].parentNode.hidden = true;
}
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2019 06:13 AM
Well, we're on Madrid and "Hide attachment" [no_attachment_v2] simply isn't working:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2019 07:46 AM
Are you also using the new widget or an old one or and old cloned one which won't get any updates from patches/upgrades? Just being on Madrid is not enough.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2019 09:17 AM
Yep, we have a cloned catalog item widget... that's the culprit.
Thanks!