Loading

Create a Validation Rule for an Opportunity in which Close Date is less than Created Date

Publiseringsdato: Apr 2, 2026
Beskrivelse
To create a validation rule for opportunity wherein the close date is less than the created date, we use the following syntax:  CloseDate < DATEVALUE(CreatedDate)

However, this rule does not work on Opportunity creation because no 'CreatedDate' value exists yet. In this case, include ‘CreatedDate’ as ‘NULL’ in order to trigger the rule on the creation of an Opportunity.
Løsning


Steps to Create a Validation Rule for Opportunity records with Close Date that is less than Created Date


In Lightning Experience: Setup > Object Manager > Opportunity > Validation Rules

In Salesforce Classic: Setup > Customize > Opportunities > Validation Rules
 

  1. Click New
  2. Enter a Rule Name
  3. Under the Error Condition Formula, enter the formula: CloseDate < (IF(ISNULL(CreatedDate), TODAY() , DATEVALUE(CreatedDate)))
  4. Enter an Error Message
  5. For Error Location, select Top of page
  6. Click Save
Flere ressurser

Validation Rules

DATEVALUE

Knowledge-artikkelnummer

000383389

 
Laster
Salesforce Help | Article