Loading

Conditionally make a field required

Publiceringsdatum: Aug 6, 2024
Beskrivning
It's possible to conditionally make a field required by using a validation rule.
Lösning

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.

Ytterligare resurser

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

Validation Rules
Examples of Validation Rules

Trailhead - 
Create Validation Rules

Knowledge-artikelnummer

000385092

 
Laddar
Salesforce Help | Article