In Salesforce, you can conditionally make a field required based on the values of other fields by using a Validation Rule. A Validation Rule uses a formula to evaluate record data. If the formula evaluates to TRUE, Salesforce prevents the record from being saved and displays an error message to the user.
This approach is useful when a field should only be required under specific conditions—for example, requiring a field to be completed only when a related picklist field has a particular value. This article provides a sample validation formula and step-by-step instructions for creating a conditional required field validation rule in both Salesforce Classic and Lightning Experience.
The following Validation Rule formula can be used as a reference for making a field conditionally required:
AND(Account_Market = "Corporate", Test = "")
This formula makes the Test field required when the Account_Market field value is "Corporate".
The formula returns TRUE (triggering the validation error and preventing the record from being saved) when both of the following conditions are met:
If either condition is not met, the formula returns FALSE, and the record is saved successfully.
Modify the field API names (Account_Market, Test) and the comparison value ("Corporate") to match your Salesforce object and business requirements.
000385092

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.