Salesforce provides multiple ways to make a custom field required, including field-level requirement, page layout requirement, validation rule, and Dynamic Forms. This article describes each option and when to use it.
This article explains how to make a custom field required in Salesforce using four methods: field-level requirement, page layout requirement, validation rule, and Dynamic Forms. Use Field-Level Requirements when the field must always be populated regardless of how records are saved, including API and integrations. Use Page Layout Requirements when the field should only be required for users on a specific layout. Use Validation Rules for conditional logic. Use Dynamic Forms for Lightning Experience for page-specific requirements.
This is the most restrictive option. It requires the field to be populated every time, regardless of how the record is saved (for example, through an integration, the API, mass upload, or the user interface). For more information, see Require Field Input to Ensure Data Quality.
This option makes the field required only when the record is accessed through the specific page layout where you set the requirement. You can make the field required for users on one page layout but not for others. For more information, see Customize Page Layouts with the Enhanced Page Layout Editor.
Note: This requirement applies only when the record is edited in the user interface. The field requirement does not apply when records are updated through the API.
A validation rule blocks a save when its formula returns true. The simplest validation rule to make a custom field required uses this formula. The formula returns true, and shows the error, when the custom field is empty:
ISBLANK(Enter_Custom_Field_API_Name_Here__c)
If the field is a Number or Currency type field, use this formula instead. It returns true, and shows the error, when the field has no value:
ISNULL(Enter_Custom_Field_API_Name_Here__c)
You can build more complex validation rules with conditional statements to meet your business needs. For more information, see Define Validation Rules.
Note: Like the field-level setting, a validation rule applies all the time, regardless of where the record is created or updated.
Dynamic Forms lets you make fields required on New and Edit modals and on Lightning Record Pages. For more information, see Required and Read-Only Fields in Dynamic Forms.
Note: If you set a field on a Lightning page to Required or Read-Only in the Lightning App Builder property panel, the behavior applies only to the field on that page, not to all instances of the field.
000384974

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.