Published at: 2025-10-30

Validation Rules


Validation Rules Usage Scenarios

When creating or editing data for an object, the system validates whether the entered information is legitimate or meets business requirements before saving. For example: When saving Account information, the system can validate whether the [Mobile Number] field meets requirements. If validation fails, you can configure whether to block the save operation in validation rules.

User Guide

2.1 Access Path

Preset Objects/Custom Object Management → Validation Rules

2.2 Basic Configuration of Validation Rules

  • Usage Scenarios

    • New Creation: Triggers validation when entering the create/edit page via the “New” button

    • Edit: Triggers validation when entering the edit page via the “Edit” button on the detail page

  • Validation Result Handling

    • If the validation result is true, the system will:

      • Block with Alert: Display the configured message and prevent saving

      • Warn without Blocking: Display the message but allow users to choose whether to proceed

2.3 Advanced Configuration

  • Advanced Mode:
    Enable this mode to configure fields from the Primary Object and lookup-related objects. Note: Using statistical or formula fields from related objects may cause delays in rule activation after configuration.

2.4 AI-Powered Formula Generation

  1. After adding a rule, trigger the AI Formula Assistant by typing “/” or clicking the AI button.
    picture coming soon:

  2. Enter a formula description, and the AI will generate the formula automatically.
    picture coming soon:

  3. Click Copy or Apply to use the AI-generated formula.
    picture coming soon:

2.5 Handling Empty Values in Formulas

For non-numeric, non-currency, and non-percentage fields, the “Default to Zero When Field Is Empty” option does not apply. Empty values in calculations or logical operations will cause errors. Use the ISNULL function to handle empty values explicitly.
picture coming soon:

Supported Field Types:

  • Currency, Date, DateTime, Email, Address, Text Area, Decimal, Number, Percentage, Phone, Picklist, Text, Boolean, URL

  • Geolocation, Check-in, Payment components

  • Formula fields, Roll-up fields, and related object formula/roll-up fields

Supported Functions:

Return Type

Operator/Function

Parameters

Description

Example

Generic

()

-

Specifies operator precedence

 

Depends on Input

IF(logical_test, value_if_true, value_if_false)

3 params: 1st=Boolean, 2nd/3rd=same type

Returns value_if_true if condition is met

34 = IF(true, 34, 52)

 

CASE(expression, value1, result1, ..., else_result)

Variable params: result(n) and else_result must match

Returns result(n) if expression=value(n), else else_result

33 = CASE(3, 2, 2, 3, 33, 1.3)

 

NULLVALUE(expression, substitute_expression)

2 params: 1st=Boolean, 2nd=any type

Returns substitute_expression if expression is null

1 = NULLVALUE(Null, 1)

Numeric

+, -, *, /

2 numeric/currency/percentage params

Performs arithmetic operations

6 = (3+2)*6/5

 

- (date subtraction)

2 date params (returns days)

Calculates date difference in days

24 = DATE(1982-04-13) - DATE(1982-03-20)

 

VALUE(string)

1 text param

Converts text to number (returns null if invalid)

-1982.0413 = VALUE('-1982.0413')

Date/DateTime

YEAR(date), MONTH(date), DAY(date)

1 date/datetime param

Extracts year/month/day component

1982 = YEAR(DATE(1982-04-13))

Text

&

2 text params

Concatenates strings

"张三李四" = "张三" & "李四"

Boolean

AND(), OR(), NOT()

Boolean params

Logical operators

true = AND(2>1, 5>3)

 

ISNULL(expression)

1 param of any type

Checks for null values

false = ISNULL(5)

2.6 Notes

  • Multiple validation rules execute sequentially by creation time.

  • Rules can be enabled/disabled. Disabled rules won’t trigger.


Troubleshooting Validation Rules

3.1 Roll-up Fields in Validation Rules Not Triggering

#### Scenario:
1. Rule blocks edits but not new creations.
2. Roll-up fields meet conditions during creation but don’t trigger validation.

Root Cause:

Validation rules using roll-up fields from lookup-related objects may reference stale data during edits (previous saved values) or miss new data during creation.

Solution:

Use pre-validation functions in save buttons instead.

picture coming soon:

Example:
An order detail rule blocks saves if Available Quantity < 0. Despite showing -10 during creation, the save succeeds because the roll-up field isn’t validated in real-time.

picture coming soon:


3.2 Owner Department Validation Fails

#### Scenario:
Rules using the owner’s primary department (or related object owner’s department) don’t block saves.

Root Cause:

Owner department fields populate after validation during creation.

Solution:

Configure pre-validation functions to fetch department data via owner ID.

picture coming soon:


3.3 Empty Values in Formula Fields

#### Scenario:
A rule blocks saves if Order Amount (Original Currency) <= 0, but empty values bypass validation.

Solution:

Enable Default to Zero When Field Is Empty for numeric fields.

picture coming soon:

Note: For non-numeric fields, use ISNULL to handle empty values.

picture coming soon:

Submit Feedback