- 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 05:41 AM
business rule should be on before delete on sys_attachment table and not on std_change_record_producer
no script required, only keep this
current.setAbortAction(true);
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 09:11 AM
My lead is not approving the same .that is why i am using the logic on
std_change_record_producer,please help me with my query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 10:10 AM
then your lead probably doesn't know much about how sys_attachment works
Can't help much then
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:10 PM
So what could be the best reason to say that this solution won't work