Remove Attachment Delete Icon in Portal

Ashwin Perumal1
Tera Contributor

Hello All,

I have a requirement to restrict deleting attachments for closed Incident or Request Ticket in portal attachments tab. I could see users deleting attachments from closed or cancelled tickets which should be restricted in portal. I was looking on Standard Ticket Attachments widget but could not find a solution to restrict users deleting attachments. Attaching below image for reference.

AshwinPerumal1_0-1715242453647.png

I want to remove the "X" icon from portal so that end users will not be able to delete any attachment when ticket is closed or cancelled. Can anyone pls help me to achieve this. Thanks in advance

 

2 REPLIES 2

Sid_Takali
Kilo Patron
Kilo Patron

Hi @Ashwin Perumal1 Refer the following KB Article. 

 https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0825743 

 

Try below code in Business Rule

(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.state == closed || current.state == cancelled){
current.setAbortAction(true);
}
})(current, previous);

 

Regards,

Siddharam

 

dgarad
Giga Sage

Hi @Ashwin Perumal1 

 

For preventing from delete, you need to update Delete ACL of attachment table as per the requirement.

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad