Restrict adding/deleting attachments on closed HR Case on HR Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2019 07:10 AM
I want to restrict users from adding or deleting attachments on HR Cases that are in the Closed state on the HR Service Portal. Client Script with disableAttachments() does not work on HR Service Portal. How else can I achieve this?
Thank you!
Holly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2019 08:20 AM
Hi Holly,
Is the HR case form editable when it is in closed state?
if yes then the attachment icon should not be shown
why disableAttachments() is not working? what error you are getting?
Regards
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
‎07-30-2019 06:59 AM
Let me start by saying I am not working through this in a client's instance. I am working through this in my personal dev instance, so this is all based on platform OOB functionality. I have no customization in my personal dev.
As a user with only the hrsp_employee client role, I can only add additional comments and attachments to the HR Case, whether it is open or closed. I do not have the ability to edit any other fields.
So currently, I have this OnLoad Client Script:
function onLoad() {
g_form.disableAttachments();
}
Again, as a user with only the hrsp_employee client role, I can still add attachments to the HR Case through the HR Service Portal). However, I cannot add attachments to the HR Case through the native UI. So the Client Script appears to work on native UI but not HR Service Portal.
What do I need to do to the script to make it work on the HR Service Portal as well?
Or do you have any other ideas on how to restrict adding/removing attachments to an HR Case through the HR Service Portal.
Ultimately, this only needs to be disabled when the HR Case is closed.
Thanks,
Holly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2021 12:55 PM
Did you ever get this working? I need to be able to do this as well but can't figure it out.