Business rule help - Stop insert on conditon
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 07:41 AM
Hi all, we have a custom table which is pulling in asset information, however we dont want IPhone records to create. I've tried the below business rule but having no joy, anyone know where I'm going wrong?
(function executeRule(current, previous /*null when async*/ ) {
var device = current.u_device_type;
if (device == "IPhone") {
current.setAbort(true);
}
})(current, previous);
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 08:24 AM
Hi @Andrew18
Glad that it's working for you, but it can't be related to current.operation() == 'insert'.
You can abort any database transaction with current.setAbortAction(true), as long as it's an Before business rule.
Kindly close the thread by marking the correct response as correct.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.