Loading

Use Validation Rules to Enforce Data Quality on Leads

Publiceringsdatum: Apr 2, 2026
Beskrivning

Salesforce administrators can use Validation Rules on the Lead object to enforce data quality standards before a record is saved. This article covers two common use cases: (1) requiring an email address and phone number before a Lead can be converted, and (2) in Salesforce Essentials Edition, preventing users who don't own a Lead record from editing it. A Validation Rule contains a formula that evaluates field data and returns True or False — when True, the rule blocks the save and displays a configurable error message.

Lösning

A common use case is when a Lead record may initially be created without an email address or phone number, but these fields must be populated before the Lead is converted. To enforce this requirement, you can create a Validation Rule by following the steps below:

Steps to Create the Validation Rule

  1. Click the Gear icon in the top-right corner.
  2. Select Setup.
  3. Navigate to Object Manager.
  4. Select Lead.
  5. Click Validation Rules from the left panel.
  6. Click New.
  7. Enter a Rule Name (e.g., Contact Information Required).
  8. Check the Active checkbox.
  9. Provide a Description (e.g., Email address and phone number are required prior to Lead conversion).

Error Condition Formula

Enter the following formula in the Error Condition Formula field:

 
AND( IsConverted, OR( ISBLANK(Phone), ISBLANK(Email) ) )
  1. Click Check Syntax to validate the formula.
  2. Enter an Error Message (e.g., An email address and phone number are required before converting the Lead).
  3. Choose the desired Error Location.
  4. Click Save.

Starter Edition (Essential Edition) Use Case

In Salesforce Essentials Edition, where Sharing Rules are not available, Validation Rules can be used to restrict record editing.

For example, to allow only the Lead Owner or a System Administrator to edit a Lead record, create a Validation Rule and use the following formula:

 
AND( NOT($Profile.Name = "System Administrator"), NOT($User.Id = OwnerId), NOT(ISCHANGED(OwnerId)) )

Complete the remaining steps (such as adding an error message and selecting the error location) as described above to finalize the rule.

 

Knowledge-artikelnummer

000389965

 
Laddar
Salesforce Help | Article