Remove Attachment Delete Icon in Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2024 01:16 AM
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2024 01:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2024 01:53 AM
For preventing from delete, you need to update Delete ACL of attachment table as per the requirement.
Thanks
dgarad