- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 12:59 AM
Hi, how to make attachment to read-only or not-editable?
Table name: sn_hr_core_case_talent_management
Solved! Go to Solution.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 03:06 AM
Hi Brook,
You can achieve this using g_form.disableAttachments() method, like the below code:
if (condition)
{
g_form.disableAttachments();
}
Check the below links, it might help you:
https://docs.servicenow.com/?title=GlideForm_%28g_form%29#disableAttachments&gsc.tab=0
If my answer helped you in any way, mark answer as helpful and correct.
Thanks and regards,
Megha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 01:14 AM
Hi,
So are you saying you want to disable the attachment i.e. hide the paper-clip icon based on some condition
Do you want the attachments itself to be hidden for few users or for some conditions
you can use below code in client script to disable the paper-clip icon; but it would show the existing attachments
g_form.disableAttachments();
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2022 12:21 PM
Does this g_form.disableAttachments() works on the portal as well when used from catalog client script ?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 01:23 AM
Hi Brook,
1. Please refer Attachment administration
2. You can use enableAttachments()/GlideForm - disableAttachments() method to enable or disable the attachment based on condition via Client Script.
https://developer.servicenow.com/dev.do#!/reference/api/orlando/client/c_GlideFormAPI
- Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 03:06 AM
Hi Brook,
You can achieve this using g_form.disableAttachments() method, like the below code:
if (condition)
{
g_form.disableAttachments();
}
Check the below links, it might help you:
https://docs.servicenow.com/?title=GlideForm_%28g_form%29#disableAttachments&gsc.tab=0
If my answer helped you in any way, mark answer as helpful and correct.
Thanks and regards,
Megha.