How to hide "Manage Attachments" link and the attachments on the incident form

Hari1
Mega Sage

Hi,

Is it possible to hide the "Manage Attachments" link and the attachments based on users/ groups on the incident form.

find_real_file.png

Regards,

Hemanth

1 ACCEPTED SOLUTION

Hi Hemanth,

The manage attachments is to be shown or hidden to particular assignment group on incident form or always it should check if logged in user is member of particular group

Do ensure you add your logic but below is how you can do using DOM

Note: It is not recommended to use DOM

Ensure You use below

1) Isolate Script field to false

2) This field is not on form but from list you can make it false

find_real_file.png

Sample script below

1) To hide entire row of Manage Attachments and the attachments

function onLoad(){

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

}

find_real_file.png

2) To hide only the Manager Attachments link use this

function onLoad(){

document.getElementById('header_attachment_list_label').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

14 REPLIES 14

Thanks for the confirmation and glad to know that it worked.

I think you should be marking this response as correct as it contains script and would be helpful to find it quickly in future by members.

Regards
Ankur

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

Hello Ankur,

Pretty much we are in the same situation. Do you think is there any other way to restrict the attachments based on assignment groups other than using DOM Manipulation?

Looking forward to hearing your response.

@Ankur Bawiskar 

Hi,

I don't think so

Regards
Ankur

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

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Hiding the "Manage Attachments" link itself, no go. Or: Dom manipulation, not adviced.

The pop-up which appears: UI page "attachment".

You could disable attachments completely for tables (dictionary attribute No Attachments), though it doesn't sound that that's what you are after.

Restricting certain attachments themselves, see Ankur's comment.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

hi @Ankur Bawiskar  and  my requirement  was hide manage attachment for particular user in the form and its only access to the assigned to user field on the form , restricts  to all users

Thank you in advance