Business Rule
A Business Rule is server-side script that runs when a record is queried, inserted, updated or deleted, timed as before, after, async or display.
Also searched as: before business rule, after business rule, async business rule.
In practice
Before rules change values on the record being saved without a second write. After rules act on other records once this one is committed. Async rules run through the scheduler for work that must not slow the transaction. Display rules pass server data to the client through g_scratchpad.
Example
A before update rule on incident that stamps a reopen count when state moves from Resolved back to In Progress.
// Before update — set the field, never call current.update()
if (previous.state == 6 && current.state == 2) {
current.u_reopen_count = parseInt(current.u_reopen_count || 0, 10) + 1;
}What interviewers check
The killer question is why current.update() inside a before rule is a bug — it recurses and writes twice.
Practise this topic
Related Automation terms
- GlideRecordGlideRecord is the server-side ServiceNow API for querying, inserting, updating and deleting records, walking results row by row through query() and next().
- GlideAjaxGlideAjax is the client-side API for calling a Client Callable Script Include asynchronously, so a form can fetch server data without a page reload.
- Flow DesignerFlow Designer is ServiceNow's low-code automation builder where a trigger plus a sequence of reusable actions replaces the legacy Workflow Editor.