Loading

Conditionally make a field required

Julkaisupäivä: Aug 6, 2024
Kuvaus
It's possible to conditionally make a field required by using a validation rule.
Ratkaisu

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.

Lisäresurssit

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

Validation Rules
Examples of Validation Rules

Trailhead - 
Create Validation Rules

Knowledge-artikkelin numero

000385092

 
Ladataan
Salesforce Help | Article