restrict requestor to delete the attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 02:46 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 02:48 AM
you can use table level delete ACL on sys_attachment with proper conditions.
what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 03:33 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 04:56 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 08:27 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader