Business rules
Quick answer
Business rules are server-side scripts that run when records are queried, inserted, updated or deleted. Because they act at the database layer, they enforce logic no matter how the record changed, form, import or API, which makes them the workhorse of server automation. The skill is choosing the right when and current/previous semantics.
Key takeaways
- When they run
- current, previous, and change detection
- Keep logic reusable
- Business rule vs data policy vs flow
- Common mistakes
Business rules are server-side scripts that run when records are queried, inserted, updated or deleted. Because they act at the database layer, they enforce logic no matter how the record changed, form, import or API, which makes them the workhorse of server automation. The skill is choosing the right when and current/previous semantics.
When they run
current, previous, and change detection
Inside a rule, current is the record now and previous is its pre-change state. Detect transitions precisely:
current and the platform saves them, never call current.update(), which causes recursion. In an after rule you touch other records with a fresh GlideRecord.Keep logic reusable
A business rule should orchestrate, not hold hundreds of lines. Put shared functions in a Script Include and call it from the rule, so the same logic serves multiple rules, flows and APIs.
Business rule vs data policy vs flow
current.setAbortAction(true)).Common mistakes
- Calling
current.update()inside a before rule, recursion; just set the field. - Heavy queries in a synchronous rule, slowing every save, move to async.
- Duplicating logic across rules instead of a shared Script Include.
- Using a business rule where a data policy or flow was the right tool.
Want to learn this properly?
Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.
Check your understanding
A business rule runs on the...
- A. Server
- B. Client
- C. Printer
Show answer
A. Server
Business rules are server-side.
To adjust a value before it saves, use a...
- A. Before rule
- B. After rule
- C. Display rule
Show answer
A. Before rule
Before rules run prior to the database write.
Which runs off the main transaction?
- A. Async
- B. Before
- C. Display
Show answer
A. Async
Async rules are scheduled just after the change.