Before buisines rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2025 02:40 AM
Can delete a record in incident table once we set the impact,urgent,priority to 1
Like can we write a script in Before BR for both creating inc with priority high and after creating it can we delete it using same BR ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 12:49 AM
Did you get a chance to review this ?
If my response helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2025 12:56 AM
This seems more of a interview question. It can have multiple answers.
1. A before operation BR can insert the record in incident table.
2. Trigger an custom event from the same BR and pass current record sys_id as parameter of event.
3. Write the script action (which refers event created / triggered) to delete the record ads event has the sys_id as parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2025 01:25 AM
Hi
Technically yes — you can call current.deleteRecord() in a before insert or after insert BR.
Example in Before Insert BR:
if (current.impact == 1 && current.urgency == 1 && current.priority == 1) {
gs.addInfoMessage("P1 incidents are not allowed.");
current.setAbortAction(true); // prevents insert }This will block the record from being created at all (safer than creating then deleting).
If you use an After Insert BR and do current.deleteRecord(), the record will get created, then immediately deleted.
Best practice
If the rule is “No P1 incidents allowed,” the cleanest way is to abort insert in Before BR rather than creating then deleting.
That way the user gets a clear message, and you don’t risk data inconsistencies.
If my answer helped you, please mark it - Solution accepted.
Thank you,
Pranita