Skip to content

Commit a8f0795

Browse files
Create README.md
Updating script use cases
1 parent 2f5b8cd commit a8f0795

File tree

1 file changed

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

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Using current.update() in Business rule is not recommended from servicenow due to following reasons-
2+
1. Before- Records will be saved automatically after BR executes so using current.update is redundant
3+
2. After- Triggers all "before" BRs again causing recursion calls and performance issue
4+
3. Async- Same issue as in After
5+
4. Query- current object doesn't exist and will cause error
6+
5. Display- Runs before UI is rendered. Using current.update doesn't make sense.
7+
8+
To avoid such scenarios, a business rule can be configured on the 'sys_script' table will trigger an error message and
9+
block the creation of any new business rule if it detects the use of current.update() within the script.
10+
11+
Runs: onBefore insert.

0 commit comments

Comments
 (0)