- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 06:04 AM
Hello,
We have a requirement to disable attachment in form header on a particular view.
Users can view the attachment if any exists on the form but they cannot add or remove or edit attachment.
We have gone through the below links where we can hide it on the table level-
https://community.servicenow.com/community?id=community_question&sys_id=fc1157e9dbdcdbc01dcaf3231f961923.
Can anyone suggest for the above requirement if you have any ideas?
Thanks,
Sowmya
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 06:18 AM
Hello,
Here is the working code. Make sure you replace view name in place of ess ok.
function onLoad() {
//Type appropriate comment here, and begin script below
var view = getView();
if (view == 'ess'){ //self service view name is ess so make to ess
g_form.disableAttachments();
}
}
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 06:18 AM
Hello,
Here is the working code. Make sure you replace view name in place of ess ok.
function onLoad() {
//Type appropriate comment here, and begin script below
var view = getView();
if (view == 'ess'){ //self service view name is ess so make to ess
g_form.disableAttachments();
}
}
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2022 03:43 PM