Published at: 2026-09-17
Configure validation rules
Validation Rules check field values before users save new or edited object data.
Overview
A validation rule is a logical formula. When it returns
true, the system blocks the save or displays a warning.Before you begin
- Identify the Custom Object or Standard Object and fields.
- Identify each Related Object used by the formula.
- Define whether the rule runs during creation, editing, or both.
- Draft the Help Text shown to users.
Procedure
Step 1: Open Validation Rules
- Sign in to Setup, and go to Object Management.
- Open the object and select Validation Rules.
- Click Create.
Step 2: Configure properties
- Enter a Rule Name and description.
- Select Create, Edit, or both as the usage scenario.
- Configure save blocking:
- Block displays a message and prevents save.
- Do Not Block displays a warning and offers Continue to Save.
- Enter the message shown when the formula returns
true.
Step 3: Configure the formula and null handling
- Enter a logical formula, such as
Start Date > End Date. - Enable Advanced Mode to reference primary-object fields or properties through a Lookup.
-
Enter
/or click AI Formula Assistant to generate a formula from a business requirement. -
For numeric calculations, configure empty fields to default to zero.[!WARNING] Default-to-zero does not apply to nonnumeric fields. Use
ISNULL(field)explicitly for dates, text, and similar fields. - Click Save.
Troubleshooting
1. A related Roll-Up Summary behaves differently on create and edit
-
Cause: The rule reads the last saved summary value, not the value currently calculated on the page.
-
Resolution:
- Replace the detail Formula with a numeric field and a default-value formula for client-side calculation.
- Or run a pre-validation function from the Save button.
2. The rule uses Owner’s Primary Department or Owner’s Department
The department is assigned after the record is stored, so it is unavailable during the initial save.
This timing also means the Owner’s Primary Department, Owner’s Department, and Created On values might not be available before Save and Submit.
Use a cross-object reference to Owner.Primary Department instead. The owner already has a value during creation.
3. Invalid data is saved
Check the following:
- Confirm that the rule is enabled.
- Confirm that the record was created or edited after the rule.
- Confirm that users entered data on a Web page. Import, OpenAPI, custom-button changes, and workflow functions bypass the rule by default.
- Review the Modification Record for a later workflow or function that cleared the value.