Courseiva

Business Rule Execution Timing and Constraints

A business rule on the Incident table runs 'after' update and calls a script include that modifies the current record. However, changes made by the script include are not saved. What is the reason?

Quick Answer

The key to this question is understanding what 'after' actually means in a business rule's execution timing: the database write has already happened by the time an after business rule runs, so the current record the script is working with is essentially a snapshot held in memory rather than a live, unsaved record waiting to be committed. When the script include changes a field on current, it is only modifying that in-memory copy; there is no pending save operation left for those changes to ride along with, so they are silently discarded unless the script explicitly performs a new database write, such as calling current.update(), to persist them. This is different from a 'before' business rule, where current still represents the record about to be written, so field changes made there are automatically included in the save that follows. The scenario's symptom, changes from a called script include simply not sticking with no error thrown, is the classic signature of this timing mismatch rather than a bug in the script include's own logic. Whenever a scenario describes a business rule that appears to modify current correctly but the changes never persist, check the 'when to run' setting first: if it says 'after,' the fix is either to move the logic to a 'before' rule or add an explicit update call, since after rules require you to save changes yourself.

⚠ Common exam trap

A common mix-up: candidates assume any business rule can modify the current record, overlooking the fundamental difference between 'before' and 'after' execution phases in ServiceNow.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The business rule is set to 'after' and cannot modify the current record.

Business rules set to run 'after' the database operation cannot modify the current record directly; any changes made to the current record in an 'after' business rule are not saved to the database. The script include may alter the record in memory, but since the database write has already occurred, those changes are discarded unless a separate database operation (like current.update()) is explicitly called.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The script include uses current.update() which triggers the same business rule recursively.

    Why it's wrong here

    Incorrect; recursion would cause an infinite loop, not prevent saves.

  • The business rule condition uses current.operation() incorrectly.

    Why it's wrong here

    Incorrect; condition is not relevant to the inability to modify.

  • The script include uses gs.sleep(1000) and times out.

    Why it's wrong here

    Incorrect; gs.sleep delays but does not prevent saves.

  • The business rule is set to 'after' and cannot modify the current record.

    Why this is correct

    Correct; after rules cannot update the current record.

About these practice questions

This SNOW-CAD question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on SNOW-CAD

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. The business rule above is intended to set the category of an incident based on the correlation_id. However, it is not working as expected. What is the most likely cause?

easy
  • A.The script is trying to set a field that is read-only before insert.
  • B.The business rule runs before insert, so the correlation_id field may not have a value yet.
  • C.The sys_choice table does not contain the choices for the incident category field.
  • D.The GlideRecord query is incorrectly using 'name' instead of 'table'.

Why B: Business rules that run 'before insert' execute before the record is saved to the database. At that point, the `correlation_id` field may not yet have a value if it is not provided by the user or set by another process. The script attempts to read `current.correlation_id` to determine the category, but if the field is empty, the condition fails and the category is never set.

Variation 2. A ServiceNow administrator notices that a business rule designed to update the 'short_description' field on the 'incident' table is not executing when a user changes the field via a custom UI page that uses GlideRecord. The script in the business rule uses current.setValue() and current.update(). What is the most likely cause?

medium
  • A.The 'short_description' field is read-only on the form.
  • B.The business rule is updating itself recursively and has been disabled.
  • C.The business rule is set to run on the server, but the custom UI page uses client-side GlideRecord which does not trigger server-side business rules.
  • D.The 'short_description' field is not in the business rule's 'Fields to update' list.

Why C: Client-side GlideRecord (g_form.getReference or direct GlideRecord in a UI page) runs entirely in the browser and does not trigger server-side business rules. Business rules execute only when a record is saved via server-side operations (e.g., form submit, web service, or server-side script). Since the custom UI page uses client-side GlideRecord, the update bypasses the business rule engine entirely.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.