- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 02:12 AM
I would like to make "Manage Attachment" Form button of OOTB table read-only only when "State" = "Approving" or "Pending".
I think it's not manageable by UI Policy, so could someone please advise on how to achieve this?
Best Regards,
Aki
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 12:35 PM
Hello
Use
g_form.disableAttachments()
g_form.enableAttachments()
Write a onload client script that if state is approving or pending
g_form.disableAttachments()
Else
g_form.enableAttachments()
Please mark answer correct/helpful based on impact
Thanks
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 12:35 PM
Hello
Use
g_form.disableAttachments()
g_form.enableAttachments()
Write a onload client script that if state is approving or pending
g_form.disableAttachments()
Else
g_form.enableAttachments()
Please mark answer correct/helpful based on impact
Thanks
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2022 12:55 AM
Hi Saurav,
Thank you for your reply.
> g_form.disableAttachments()
I think it makes the UI button disappeared. What I would like to do is to make it just "read-only".
*Users can view the attachment files, but cannot delete/add.
Would it be possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2022 01:55 AM
Hello,
The above code will just hide the paperclip so that User cannot add new attachment but they can view/download existing attachment. Please see screenshot below:-
Form with out the code:-
Form with the code:-
Please mark answer correct/helpful based on impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2022 01:11 AM
Hi,
can you share screenshot for better understanding?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader