How to hide Remove button from the Attachment on Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2022 09:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2022 09:16 AM
Hi Gagana,
That I guess will need DOM manipulation. Instead why not restrict deletion action. You can refer thread for solution of ACL for required table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2022 09:16 AM
Hello Gagana,
Can you try below approach to restrict the user for deletion and modify the logic as per your requirment.
Before-Delete Business rule restrict users other than Admin to abort in deleting the attachment on 'sc_req_item' table
Name: Restrict Delete attachment on RITM
Table: sys_attachment
Advanced: check
When: Before
Delete: check
Filter Condition: Table Name is sc_req_item
Script Conditon:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(!gs.hasRole('admin')){
current.setAbortAction(true);
}
})(current, previous);
please mark my answer correct if it helps you
Thanks,
Pratheep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2022 09:23 AM
Hi
> You cannot hide that button without DOM
> You can open the delete ACL for sys_attachment table
> Add a role as admin
So that no other user can delete the attachment.
If you want it for specific table or condition, you can add it.
Mark as correct and helpful if it solved your query.
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2022 09:28 AM
Hello,
Have done similar requirement, you can modify delete ACL on sys_attachment table and for 'Global' scope and include logic to exclude caller from deleting attachment.
https://instance/sys_security_acl_list.do?sysparm_query=name%3Dsys_attachment%5Eoperation%3Ddelete&sysparm_first_row=1&sysparm_view=
Regards
Regards,
Musab