Loading

Conditionally make a field required

Veröffentlichungsdatum: Aug 6, 2024
Beschreibung
It's possible to conditionally make a field required by using a validation rule.
Lösung

The following Validation Formula can be used as a reference.

AND(Account_Market = "Corporate", Test = "")

This will give an error message if "Test" has no value when Account Market is "Corporate". 
 

Create validation rule in Salesforce Classic

 

1. Click Setup.
2. Click Customize | [the object you need to modify] | Validation Rules
3. Click New.
4. Enter the Validation Rule name.
5. Set the Validation Formula as per the suggestion above, feel free to adapt to your needs.
6. Set the error message that the User will receive. 
7. Click Save.

 

Create validation rule in Lightning Experience

 

1.Click the gear icon then Setup
2. Click Object Manager | [the object you need to modify] | Validation Rules
3. Click New.
4. Enter the Validation Rule name.
5. Set the Validation Formula as per the suggestion above, feel free to adapt to your needs.
6. Set the error message that the User will receive. 
7. Click Save.

Zusätzliche Ressourcen

For assistance with your specific formula, visit the Salesforce Trailblazer Developer Community.

Validation Rules
Examples of Validation Rules

Trailhead - 
Create Validation Rules

Nummer des Knowledge-Artikels

000385092

 
Laden
Salesforce Help | Article