Skip to content

Commit 6ee6eff

Browse files
Create script.js
script update
1 parent 2528aca commit 6ee6eff

File tree

1 file changed

+12
-0
lines changed
  • Server-Side Components/Business Rules/Prevent Creation of Recursive BR

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(function executeRule(current, previous /*null when async*/) {
2+
// Check if the script contains 'current.update()'
3+
if (current.script && current.script.toLowerCase().includes('current.update()')) {
4+
var errMsg = "Error: 'current.update()' should not be used in Business Rules.";
5+
6+
// Abort the insert/update operation
7+
gs.addErrorMessage(errMsg);
8+
current.setAbortAction(true);
9+
}
10+
11+
12+
})(current, previous);

0 commit comments

Comments
 (0)