how to restrict removing attachment from portal for scoped applicatin

Prati
Tera Contributor

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.

2 REPLIES 2

Musab Rasheed
Tera Sage
Tera Sage

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

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

Community Alums
Not applicable

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