how to restrict removing attachment from portal for scoped applicatin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 04:40 AM
Hi All,
if anyone can help me on how to restrict attachment removal from service portal. It is for only portal so when attachment is added by agent they should not be able to remove it.
Thanks and Regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 04:47 AM
Hello,
You have to tweak delete ACL that applies to application where you want to restrict, basically you can add role like Admin so that only admin can delete rest cannot delete, Once you implement this then delete icon will be hidden
Mark my answer as correct if that helps
https://yourinstance/sys_security_acl_list.do?sysparm_query=nameSTARTSWITHsys_attachment%5Eoperation.nameSTARTSWITHdelete&sysparm_first_row=1&sysparm_view=&sysparm_choice_query_raw=&sysparm_list_header_search=true
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 11:52 PM
Hi Prati,
You need to either edit the delete ACL or create a business rule on sys_attachment table before delete. Business rule route is easy though
When: before delete
Conditions: Table is sc_req_item //if you only want to have this rule in place for request item table
Script:
if(!gs.hasRole('admin') || !(current.sys_created_by==gs.getUser().getEmail())){
current.setAbortAction(true);
}
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep