Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2024 10:08 AM
Can anyone share a business rule script example that prevents record deletion under certain conditions
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2024 02:20 PM
Hi there @Yashsvi
you can use an br like below
(function executeRule(current, previous /*null when async*/) {
/
if (current.u_status === 'Closed' && current.u_impact === 'High') {
gs.addErrorMessage('Cannot delete record because it is closed with high impact.');
current.setAbortAction(true);
}
})(current, previous);
☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2024 07:53 PM
Hi @nafiz435,
Unless you are applying some complex logic, there is no need to write a script.
Select Delete and set your condition as per your need, e.g.
Under the Actions tab, select Abort action. Feel free to add a message if required as well
Cheers