- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:34 AM
Hi All,
I have a requirement to restrict users from deleting attachments in a change ticket once the state changes to "Scheduled." However, users should still be able to add attachments in any state.
I have implemented a before/delete Business Rule, but it is not showing any error. The system allows the user to delete the attachment, and after the page refreshes, the document reappears. This partial behavior is confusing for the user. Although the attachment is not actually deleted, there is no error message, and the user only realizes the attachment wasn't deleted after the page refreshes. However, after clicking the remove button, it appears as if the attachment was removed.
I am looking for an approach where, if the user tries to remove an attachment after the state is "Scheduled," the system will throw an error.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 10:18 AM
Can you share your business rule? Was your business rule on the attachment table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2024 10:34 AM - edited 11-22-2024 10:35 AM
I got an ACL to work. I had to modify an OOB ACL to get it to work. As you can see from the screenshot below it removes the checkboxes next the the attachments and the remove button is not visible.
The ACL I modified can be found here https://[instance].service-now.com/nav_to.do?uri=sys_security_acl.do?sys_id=0c66472a0a0a0b82017c1f3df66a3fe7
I added the following code right after var tableName = current.table_name;
//Handel change request files
if (tableName == "change_request") {
var changeRequest = new GlideRecord('change_request');
if (changeRequest.get(current.getValue('table_sys_id'))) {
if (changeRequest.state >= -2) //Value of "Scheduled" state
{
return false;
} else {
return true;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 09:43 AM
Hi @Brian Lancaster ,
I did not get the proper solution. Could you please help me on this? Can we achieve through ACL?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 11:34 AM
I just tried your Business rule and it works for me. It does not display the error message but it does prevent the removal of the attachment. Once you reload the form you will see that the attachment is still there. I'm note sure you can display the error message since the BR is on the attachment table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 10:43 PM
That might confuse the user. Although the attachment is not actually deleted, there is no error message, and the user only realizes it wasn't deleted after the page refreshes. If we cannot display an error message because the Business Rule is on the attachment table, can we disable the "Remove" button once the Change Request state changes to "Scheduled" or beyond? However, users should still be able to add attachments in any state.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2024 10:34 AM - edited 11-22-2024 10:35 AM
I got an ACL to work. I had to modify an OOB ACL to get it to work. As you can see from the screenshot below it removes the checkboxes next the the attachments and the remove button is not visible.
The ACL I modified can be found here https://[instance].service-now.com/nav_to.do?uri=sys_security_acl.do?sys_id=0c66472a0a0a0b82017c1f3df66a3fe7
I added the following code right after var tableName = current.table_name;
//Handel change request files
if (tableName == "change_request") {
var changeRequest = new GlideRecord('change_request');
if (changeRequest.get(current.getValue('table_sys_id'))) {
if (changeRequest.state >= -2) //Value of "Scheduled" state
{
return false;
} else {
return true;
}
}
}