Hide attachment on Record Producer " Report Vaccination" which is in "Vaccination Status" Application

Feddy
Kilo Sage

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.

1 ACCEPTED SOLUTION

@Feddy 

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:

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

31 REPLIES 31

Hi,

Are you having any onSubmit client script which is using Synchronous Ajax call

If yes then it will break as it is not allowed

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

we dont have any onsumbit script and we have to onchane but they were created using asyn call(getxml).

Not very much sure on that

please check if same error comes for other record producers as well.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 
IF you have worked on change approval policy can you please help me here?

https://community.servicenow.com/community?id=community_question&sys_id=b0896a3edb516450fb115583ca961998

Nope haven't worked on that

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader