Help with script to hide attachments section in header on form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 04:48 PM
I have a requirement to hide the attachments in the header of a form, as well as the attachment icon (paperclip) when the form loads, and the user isn't a member of a specific group. I already have the group membership portion working to hide form sections and related lists but haven't been able to get the actual attachments to hide. I created a new script just for to see if I can hide the attachments, but still no luck.
Here is what I have currently, which is hiding the paperclip icon as expected, but the actual attachments are still shown. Isolate script in unchecked.
function onLoad() {
g_form.disableAttachments();
document.getElementById('header_attachment').style.display = 'none';
document.getElementById('header_attachment_line').style.display = 'none';
}
When loading form attachments are still displayed, but paperclip is hidden:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 01:10 PM
I've seen the same things suggested throughout the Community, but no matter what I do the script doesn't hide the attachments. I've gone as far as disabling all other client scripts for the table and the attachments still show regardless of the user viewing the record(s).
At this point I think I'll just have to wait until we upgrade to Xanadu and the Deny Unless option is available.