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-23-2025 10:21 AM
Hi @krishna_1B ,
No it is not possible with Before business Rule but what is your use case?
If my answer helped you, please mark it - Solution accepted.
Regards,
Nikhil Bajaj
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2025 12:23 PM
Hi @krishna_1B
There is a safe approach for you require
Instead of allowing the record to be created and then deleting it, you can stop the record from ever being created in the first place.
May you handle using a Before > Insert Business Rule
Code:
if (current.operation() == 'insert' && current.impact == 1 && current.urgency == 1 && current.priority == 1) {
gs.addErrorMessage("Incidents with Priority 1 cannot be created.");
current.setAbortAction(true); // stop the insert
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2025 02:13 PM
Hi @krishna_1B ,
what is the context? what is the business requirement? Your question is quite confusing.
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2025 05:39 PM
Answer is NO. Before BR are run before a record is inserted to the database. If you create a before BR to update the Impact, Urgency and Priority to 1 but not completing the DB operation and trying to delete the record, it will not be recorded in the database. You should always validate business requirements and whether it would help optimize your processes before scripting. Even if something is possible in scripts, you should always think from best practices perspective and long-term impact & the justification for creating a custom script in the first place.
Business Rules are server-side scripts that performs database operations when a record is inserted/updated/deleted/queries. 'When' is a choice field in BR and dictates when it should execute before/after/async/display.
You can find more information from below link,
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan