---
sourceDocument: Brazil API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/api-reference

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Classic Business rules

# Classic Business rules {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Classic Business rules

Classic Business rules in ServiceNow are server-side scripts that execute during record operations such as display, insert, update, delete, or query on a table.
They enable automation by running when specific server-side conditions are met.
While business rules are a traditional scripting solution, ServiceNow recommends using Workflow Studio for new process automations due to its extensibility and maintainability.
This documentation primarily supports working with existing business rules in your instances.
Show full answer Show less  

## When Business Rules Run

Business rules execute based on two criteria: the timing relative to database operations and the type of record operation involved. The timing options include:

* **Before:** Runs before any database action after form submission.
* **After:** Runs after database action completion.
* **Async:** Runs asynchronously after form submission, scheduled by the system.
* **Display:** Runs before a form is shown to the user.

Each timing affects how the rule interacts with data, such as limitations on using certain methods (e.g., changes() methods do not work in async rules). Business rules apply consistently regardless of access via forms, lists, or web services.

## Record Operations

Business rules can be configured to run on specific record operations:

* **Insert:** When a new record is created.
* **Update:** When an existing record is modified.
* **Query:** When records are queried (usually used with before rules).
* **Delete:** When a record is deleted.

Note that business rules only trigger when operations are performed through the GlideRecord API, and can be bypassed intentionally or by using setWorkflow(false).

## Business Rule Actions

Business rules allow you to automate various actions such as:

* Setting or changing field values based on user input or other fields.
* Displaying information messages to users.
* Updating related child records based on parent record changes.
* Restricting access or editing capabilities on certain fields.
* Preventing record saves by aborting database transactions under conditions.

Administrators can configure many of these actions without scripting, simplifying rule creation for common scenarios.

## Best Practices and Considerations

* Avoid using `current.update()` inside business rules to prevent recursion and performance issues. Instead, rely on before rules to save changes automatically and after rules to update related records.
* Use `setWorkflow(false)` cautiously with update scripts only when necessary to prevent unwanted rule executions.
* Business rules run within either the global or private application scope, and must be assigned accordingly.

## Integration with Client-Side Scripts

To control field values effectively and provide immediate UI updates, combine business rules with client scripts. Business rules ensure backend data integrity, while client scripts provide real-time feedback in forms and lists.

## Specialized Business Rules

* **Display Business Rules:** Execute when forms load to prepare data for user interaction.
* **Task Active State Management:** Automatically manages the active state based on task status changes.
* **Installation Settings:** Global business rules that dynamically determine system settings and access roles just before record display.

## Getting Started

To create or modify business rules, first determine the appropriate timing and record operations they should respond to. Utilize predefined global variables for scripting and refer to example scripts to align with organizational requirements.  
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.  
Business rules are scripts that run when certain server-side conditions are met. Business rule conditions include when to run a business rule in relation to a database operation, and what record operations the business rule applies to. There are other scripting options available on the platform for client-side conditions, such as client scripts and UI actions.  
Note:  
Business rules are a classic automation solution that rely on scripting. Use Workflow Studio for any new process automation to create automations that are easier to extend, reuse, understand, and upgrade. As many organizations have business rules in production, use this documentation to learn how to work with existing business rules.

To configure business rules, you first need to determine when the business rule should run and what action it should take.

## When business rules run {#c_BusinessRules__section_ezw_cgn_rjc}

To configure business rules, you first need to determine when the business rule should run and what action it should take.  
Business rules run based on two sets of criteria.

* When to run the business rule in relation to a database operation.
* What record operation the business rule applies to.

{#c_BusinessRules__ul_q43_4h3_bp}The following options are provided to determine when the business rule should run.{#c_BusinessRules__table_w2s_1k3_bp__entry__2}

| Option | When the rule runs |
|-|-|
| Before | After the user submits the form but before any action is taken on the record in the database. |
| After | After the user submits the form and after any action is taken on the record in the database. |
| Async | After the user submits the form and after the scheduler runs the scheduled job created from the business rule. The system creates a scheduled job from the business rule after the user submits the form but before any action is taken on the record in the database. Note: Newly created business rules will run during upgrades. If a record has an asynchronous business rule that makes decisions based on the data in the record, multiple updates to the record in quick succession can cause the business rule to execute out of order or incorrectly. If multiple async business rules update the same record, the updates performed by one script could be overwritten by another script or made in an unexpected sequence because the order of execution isn't guaranteed. You can use the After option for business rules or [System Events](https://www.servicenow.com/docs/access?context=events&version=brazil&pubname=brazil-build-workflows&ft:locale=en-US) as an alternative in these situations. |
| Display | Before the form is presented to the user, just after the data is read from the database. |
[Table 1. When the business rule should run]

{#c_BusinessRules__table_w2s_1k3_bp}  
Note:  
* Asynchronous business rules do not have access to the previous version of a record. Therefore, the changes(), changesTo(), and changesFrom() GlideElement methods do not work with async rule script. However, the condition builder and condition field (advanced view) both support the changes(), changesTo(), and changesFrom() methods.
* Business rules do not honor ACLs until you want them to be honored. For more information, see [Relationship between Business Rules and Access Control Rules (ACLs)](https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0656366)
{#c_BusinessRules__ul_r2y_x2k_5tb}  
The following options are provided to determine what record operations the business rule applies to.{#c_BusinessRules__table_p2x_rk3_bp__entry__2}

| Option | When the rule runs |
|-|-|
| Insert | When the user creates a new record and the system inserts it into the database. |
| Update | When the user modifies an existing record. |
| Query | When the user queries for a record or list of records. Typically you should use the query operation for before business rules. Only query business rules on the table queried are executed---not query business rules on the tables of reference fields. |
| Delete | When the user deletes a record. |
[Table 2. What record operation the business rule applies to]

{#c_BusinessRules__table_p2x_rk3_bp}  
Note:  
Business rules only run record operations when called from the GlideRecord API. Some applications intentionally bypass business rule processing to perform record operations directly. In addition, business rules ignore API calls run with the setWorkflow() method set to false.  
This image shows when different types of business rules run:Figure 1. Business rule processing flow  
Note:  
Business rules apply consistently to records regardless of whether they are accessed through forms, lists, or web services. This is one major difference between business rules and client scripts, which apply only when the form is edited.

## Business rule actions {#c_BusinessRules__section_fzw_cgn_rjc}

Business rules can perform a variety of actions. Common types of actions are:

* Changing field values on a form that the user is updating. Field values can be set to specific values available for that field, values copied from other fields, and relative values determined by the user's role.
* Displaying information messages to the user.
* Changing values of child tasks based on changes to parent tasks.
* Preventing users from accessing or modifying certain fields on a form.
* Aborting the current database transaction. For example, if certain conditions are met, prevent the user from saving the record in the database.
{#c_BusinessRules__ul_yvs_fm3_bp}Administrators can set field values, create information messages, and abort transactions without writing a script.

## Prevent recursive business rules {#c_BusinessRules__section_gk5_ykj_ccb}

Avoid using current.update() in a business rule script. The update() method triggers business rules to run on the same table for insert and update operations, leading to a business rule
calling itself over and over. Changes made in before business rules are automatically saved when all before business rules are complete, and after business rules are best used for updating related, not current, objects. When a
recursive business rule is detected, the system stops it and logs the error in the system log. However, current.update() causes system performance issues and is never necessary.

You can prevent recursive business rules by using the setWorkflow() method with the false parameter. The combination of the update() and setWorkflow() methods is only
recommended in special circumstances where the normal before and after guidelines mentioned above don't meet your requirements.
* **[Business rules in scoped applications](https://www.servicenow.com/docs/YE8WHgXexIjgUThIkMrXqw)**   
  Every business rule is assigned to either a private application scope or to the global scope.
* **[Create a business rule](https://www.servicenow.com/docs/K56wwChLxihtNpbgGKcBJw)**   
  You can create any type of business rule to run when a record is displayed, inserted, updated, or deleted, or when a table is queried.
* **[Global variables in business rules](https://www.servicenow.com/docs/zZPo0AkD3pBAdAe2DTIRBg)**   
  Predefined global variables are available for use in business rules.
* **[Control field values using business rules and client scripts](https://www.servicenow.com/docs/ihpTlspeoPcFa0~AOoBk7Q#r_BsnsRlClntScptsCntrlFldVl)**   
  Implement both business rules and client scripts for a field to enable users to set record values properly using both forms and lists, and to see immediate changes to the values in forms as edits are made.
* **[Display business rules](https://www.servicenow.com/docs/boMjdQAa~hub4gl6XEh8fA)**   
  Display business rules are processed when a user requests a record form.
* **[Task Active State Management business rule](https://www.servicenow.com/docs/qXOIwZCpAgdazCg750g5ug)**   
  The Task Active State Management business rule determines whether the active field value needs to change based on changes to the State field.
* **[Installation settings](https://www.servicenow.com/docs/1Sx8nbkR7a~WVH73DFszfQ)**   
  Installation settings are global business rules with calculated names. Installation settings are calculated just before a record is displayed and facilitate dynamic determination of access and roles. Installation Settings permit the programmatic determination of a setting.
* **[Example business rule scripts](https://www.servicenow.com/docs/1fSFl3w1b4_KVJkcVyNkaQ#business-rule-examples)**   
  Find an example business rule script that helps you with a requirement of your organization.

**Related tasks**   

* [Create a business rule](https://www.servicenow.com/docs/K56wwChLxihtNpbgGKcBJw "You can create any type of business rule to run when a record is displayed, inserted, updated, or deleted, or when a table is queried.")

