- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:14 AM
Create a Business Rule which will trigger when record is deleted in Incident table then delete a record in Customer Incident table for that incident.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 03:15 AM
Hi,
Please use before delete business rule and update your logic as this
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents'); // give your correct table name
gr.addQuery('u_parent_inc', current.number);
gr.query();
if (gr.next()) {
gr.deleteRecord();
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2022 09:43 PM
Did you try this out ? Do you have any confusion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 03:15 AM
Hi,
Please use before delete business rule and update your logic as this
(function executeRule(current, previous) {
var gr = new GlideRecord('u_customer_incidents'); // give your correct table name
gr.addQuery('u_parent_inc', current.number);
gr.query();
if (gr.next()) {
gr.deleteRecord();
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 10:08 AM
Hi ,
Tried this approach .The record is not getting deleted from customer Incident tabel after deleting from incident table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 10:21 AM
Hi,
Is this "Customer Incident" a scoped application?
If so, make sure that you have cross-scope access to delete records from Global scope.
Do you see any helpful error messages in the system log?
What is happening when you try to delete a record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2022 09:42 PM
Hi,
are both the tables in same scope?
What's the error it shows?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader