How to hide Remove button from the Attachment on Incident form

Gagana B N1
Tera Contributor

when the incident has been created caller should not be able to delete attachments on the incident form.

find_real_file.png

How to hide Remove button on the Attachment?

 

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

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.

Pratheep1
Tera Contributor

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

SumanthDosapati
Mega Sage
Mega Sage

Hi @Gagana B N ,

> 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

Musab Rasheed
Tera Sage
Tera Sage

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.

find_real_file.png

https://instance/sys_security_acl_list.do?sysparm_query=name%3Dsys_attachment%5Eoperation%3Ddelete&sysparm_first_row=1&sysparm_view=

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab