CSA practice question 22 of 35

Which statement is true about business rules?

Full set: 500 questions
Answer options
A: A business rule must run before a database action occurs
B: A business rule can be a piece of Javascript Correct answer
C: A business rule must not run before a database action occurs
D: A business rule monitors fields on a form
Correct Answer:
B. A business rule can be a piece of Javascript
Explanation

A business rule is a server-side script that executes when a record is displayed, inserted, updated, deleted, or when a table is queried. The core logic of a business rule is defined using JavaScript in the script field. This allows developers to implement custom logic that automates processes, manages data integrity, and integrates with other systems. While simple actions can be configured without writing code, the fundamental and powerful nature of a business rule lies in its ability to execute custom JavaScript on the server.

Why Incorrect

A. A business rule can run before, after, async, or on display of a database action; it is not required to run only "before".
C. "Before" business rules are a common and valid configuration, running before the database transaction is committed.
D. Monitoring fields on a form in real-time is the function of client-side scripts, such as Client Scripts or UI Policies, not server-side Business Rules.

References

1. ServiceNow Product Documentation: "Business rules". ServiceNow

Docs > Washington DC > App Engine > Server-side scripting.

Reference for B: The documentation states

"A business rule is a server-side script that runs when a record is displayed

inserted

updated

or deleted

or when a table is queried." The platform's server-side scripting language is JavaScript.

Reference for A & C: The "When to run business rules" section details the options for the 'When' field: "before"

"after"

"async"

and "display"

confirming that a business rule is not restricted to running only before or not before a database action.

Reference for D: The documentation distinguishes server-side scripts (Business Rules) from client-side scripts

which are the ones that interact directly with the form interface.

2. ServiceNow Developer Program: "Server-side Scripting". ServiceNow

Developer Resources > Learn > ServiceNow Application Development > Scripting in ServiceNow.

Reference for B: This resource explicitly states

"Server-side scripts

such as Business Rules...execute on the ServiceNow server or database. Server-side scripts are written using the ServiceNow APIs

which are composed of JavaScript classes

methods

and non-method properties." This directly confirms that business rules are written in JavaScript.

Scroll to Top