Cert++
Close

Create versus edit functions in validation formulas

Key Takeaway

Use ISNEW() to apply a rule when a record is created and ISCHANGED to apply it when a field changes. ISCHANGED returns FALSE on a new record, so pair it with ISNEW() when a rule should cover both.

A validation rule stops a save when its formula returns TRUE. Some business rules should apply only when a record is created, only when it is edited, or only when a certain field changes. The functions ISNEW(), ISCHANGED, and PRIORVALUE tell the formula which of these is happening, so the rule fires only in the right scenario.

What each function returns on create and on edit

A validation rule formula returns TRUE or FALSE. When it returns TRUE, the user sees the rule's error message and can't save the record. Three functions let the formula react to the type of save:

FunctionWhen a record is createdWhen an existing record is edited
ISNEW()Returns TRUEReturns FALSE
ISCHANGED(field)Returns FALSE for every fieldCompares the field's current value to its previous value and returns TRUE if they differ
PRIORVALUE(field)Returns the field's current value, not nullReturns the field's previous value
Platform App Builder Study Guide

Checklist progress

0/340Learned

Given a scenario, demonstrate the use of validation rules to meet stated business requirements

0/15

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Platform App Builder studiers.