Need to Remove Attachment Icon catalog Item UI

san1989
Giga Guru

Hello All,

I have a requiremnet to remove the attachment icon from the service catalog UI.

In portal we are able to remove it by checking the field on the service catalog "remove Attachment".

But we are not able to figure it out on the UI side to remove the attchment icon.

Pleas let us know your thoughts.

Thanks

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@san1989 

No you cannot remove it from native directly.

You will require onLoad catalog client script and use DOM for this

It is not recommended to use DOM as best practice

If you still require then use below approach

1) Create catalog client script which applies only on Desktop

2) Ensure Isolate Script field is set to false. This field is not on form but from list you can make it false

Sample script below

function onLoad(){

document.getElementById('sc_attachment_button').style.display = 'none';

}

find_real_file.png

Regards
Ankur

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@san1989 

No you cannot remove it from native directly.

You will require onLoad catalog client script and use DOM for this

It is not recommended to use DOM as best practice

If you still require then use below approach

1) Create catalog client script which applies only on Desktop

2) Ensure Isolate Script field is set to false. This field is not on form but from list you can make it false

Sample script below

function onLoad(){

document.getElementById('sc_attachment_button').style.display = 'none';

}

find_real_file.png

Regards
Ankur

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

Hi Ankur,

 

is it okay if we use DOM manipulation, i see articles stating DOM manipulation is not something that we should resort to for solutions in serviceNow. Please let me know your thoughts.

 

Regards,

Pavan

@pavansanthosh 

yes it's not recommended as per best practices.

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

H S B
Giga Guru

It is no longer this complicated i guess. 

Simply open your catalog item under 'Maintain Item' module & under "Portal Settings', check 'Hide Attachment' -

HSB_0-1705647315886.png

 

 

It works 100% so shouldn't be an issue.

Do mark this answer as helpful or accepted if it helps. Thanks