- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 05:37 AM
i have to restrict non admin user to stop deleting attachment from std_change_record_producer for which i have written below code against std_change_record_producer its a before delete, please let me know where i am doing wrong , even log is not generating for the same
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 11:15 PM
The lead should already know the reason.
Reason is the delete actually works on sys_attachment as attachment is getting deleted and not the actual record on which the attachment is present.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 11:15 PM
The lead should already know the reason.
Reason is the delete actually works on sys_attachment as attachment is getting deleted and not the actual record on which the attachment is present.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 05:41 AM
Your business rule should be on the sys_attachment table instead of std_change_record_producer.
Deleting attachment will trigger BR in the attachment table. Make sure to add appropriate condition in the BR on the attachment table.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 09:11 AM
i have to do with the same, please expedite my query

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 09:48 AM
You can't on std_change_record_producer, since the BR wont trigger.
Your lead need to understand what is feasible. Another option would be to use access control on attachment table, to not allow delete if table is std_change_record_producer. It would be more complex, since attachment is a system table and you will have to be careful while adding ACLs and need proper testing.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 11:11 PM
Any specific reason for this , please let me know