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

hollysnyder
Mega Guru

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

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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

JD Barlow
Tera Guru

Did you ever get this working? I need to be able to do this as well but can't figure it out.