
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2021 10:02 PM
Hi Team,
I would like to disable attachment icon(paper clip icon) in both native view as well as in portal page for "report Vaccination" record producer. The record producer is on scoped application. Please help me here to achieve this.
Below is my catalog client script ,
Type : onload
UI type : All
script :
function onLoad() {
document.getElementById("sc_attachment_button").hide();
}
Any input on this would be much appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 02:11 AM
Till the you can use this script. It would work in portal and native both
function onLoad() {
//Type appropriate comment here, and begin script below
if(window == null){
var z = this.document.getElementsByClassName("panel-button sp-attachment-add btn btn-link");
z[0].style.display = 'none';
var k = this.document.getElementsByClassName("file-upload-input");
k[0].style.display = 'none';
var aTags = this.document.getElementsByTagName("span");
var searchText = "Add attachments";
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == searchText) {
aTags[i].style.display = 'none';
break;
}
}
}
else{
document.getElementById("sc_attachment_button").hide();
}
}
Portal Output:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 02:11 AM
Till the you can use this script. It would work in portal and native both
function onLoad() {
//Type appropriate comment here, and begin script below
if(window == null){
var z = this.document.getElementsByClassName("panel-button sp-attachment-add btn btn-link");
z[0].style.display = 'none';
var k = this.document.getElementsByClassName("file-upload-input");
k[0].style.display = 'none';
var aTags = this.document.getElementsByTagName("span");
var searchText = "Add attachments";
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == searchText) {
aTags[i].style.display = 'none';
break;
}
}
}
else{
document.getElementById("sc_attachment_button").hide();
}
}
Portal Output:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 02:17 AM
Perfect. Thanks a lot for your inputs.
I created the catalog client script in global scope . is that fine or should I create it in the scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 02:57 AM
My record producer is in Customer Service Scope so client script also created in same Customer Service Scope
Please create client script in same scope as that of the Record producer.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 03:12 AM
No it didn't work.
My global catalog client script is working but if inactivate and create the same in scope application it is not working. I have unchecked the isolate script as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 03:47 AM
Hi,
it should work fine.
Any error in browser console?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader