restrict requestor to delete the attachment

Priyansh_98
Tera Guru

I want to restrict a user from deleting an attachment from only one specific catalog item and also from the incident table. how can i solve this requirement?

can someone help me on this?

9 REPLIES 9

Ankur Bawiskar
Tera Patron

@Priyansh_98 

you can use table level delete ACL on sys_attachment with proper conditions.

what did you start with and where are you stuck?

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

hi @Ankur Bawiskar 

thanks for your response.

and i also don't want to allow user to add new attachments in the specific catalog item. 

i started with before BR to implement this but in one of article i read this ...

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0825743

 

in additional info they have mentioned this >>

 

This business rule works primarily to prevent deletion of the record in the sys_attachment table.  If when reloading the task, the attachment reappears with an attachment of 0 bytes; this is because the base64 data for the file was deleted from the sys_attachment_doc table which resulted in a broken attachment link with an empty file.

Solve this by adding a matching "on before delete" business rule to both of these tables:
sys_attachment
sys_attachment_doc

@Priyansh_98 

if you don't want users to add attachment on that catalog item then do this

1) use file attachment variable on your catalog item and show/hide it based on the user you want

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

@Priyansh_98 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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