Loading

How to Make a Custom Field Required in Salesforce: Field Level, Page Layout, Validation Rule, and Dynamic Forms

Дата публикации: Nov 9, 2026
Описание

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.

Make a custom field required at the field level

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.

In Salesforce Classic: custom object

  1. Click Setup.
  2. Go to Quick Find and enter Object.
  3. Choose the object.
  4. Under Custom Fields & Relationships, select the custom field that you will make required.
  5. Click Edit and under the General Options section select Required.
  6. Click Save.

In Salesforce Classic: standard object

  1. Click Setup.
  2. Under the Build section, click the dropdown button for Customize.
  3. Click the dropdown button for the object and click Fields.
  4. Under Custom Fields & Relationships, select the custom field that you will make required.
  5. Click Edit and under the General Options section select Required.
  6. Click Save.

In Lightning Experience

  1. Click the gear icon, then Setup > Object Manager.
  2. Choose the object > Fields & Relationships.
  3. Select the custom field that you will make required.
  4. Click Edit and under General Options select Required.
  5. Click Save.

Make a custom field required on the page layout

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.

In Salesforce Classic: custom object

  1. Click Setup.
  2. Go to Quick Find and enter Object.
  3. Choose the object.
  4. Under the Page Layouts section, click Edit on the page layout that you use on the object.
  5. Click the wrench icon beside the custom field that you will make required.
  6. Select the Required checkbox.
  7. Click Ok, then click Save.

In Salesforce Classic: standard object

  1. Click Setup.
  2. Under the Build section, click the dropdown button for Customize.
  3. Click the dropdown button for the object and click Page Layouts.
  4. Click Edit on the page layout that you use on the object.
  5. Click the wrench icon beside the custom field that you will make required.
  6. Select the Required checkbox.
  7. Click Ok, then click Save.

In Lightning Experience

  1. Click the gear icon, then Setup > Object Manager.
  2. Choose the object > Page Layouts.
  3. Select the page layout that you use on the object.
  4. Click the wrench icon beside the custom field that you will make required.
  5. Select the Required checkbox.
  6. Click Ok, then click Save.

Make a custom field required with a validation rule

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.

In Salesforce Classic: custom object

  1. Click Setup.
  2. Go to Quick Find and enter Object.
  3. Choose the object.
  4. Under the Validation Rules section, click New.
  5. Enter a Rule Name.
  6. Enter an Error Condition Formula. You can use ISBLANK or ISNULL to check that the field is not empty.
  7. Enter an Error Message.
  8. Select an Error Location.
  9. Click Save.

In Salesforce Classic: standard object

  1. Click Setup.
  2. Under the Build section, click the dropdown button for Customize.
  3. Click the dropdown button for the object and click Validation Rules.
  4. Click New.
  5. Enter a Rule Name.
  6. Enter an Error Condition Formula. You can use ISBLANK or ISNULL to check that the field is not empty.
  7. Enter an Error Message.
  8. Select an Error Location.
  9. Click Save.

In Lightning Experience

  1. Click the gear icon, then Setup > Object Manager.
  2. Choose the object > Validation Rules.
  3. Click New.
  4. Enter a Rule Name.
  5. Enter an Error Condition Formula. You can use ISBLANK or ISNULL to check that the field is not empty.
  6. Enter an Error Message.
  7. Select an Error Location.
  8. Click Save.

Make a custom field required with Dynamic Forms

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.

In Lightning Experience

  1. Click the gear icon, then Edit Page on a sample record, or open Lightning App Builder and open the Lightning Page with Dynamic Forms enabled.
  2. Select the field in the Field Section that should be required.
  3. Select Required in the right sidebar under UI Behavior.
  4. Click Save (and Activate if necessary).
Номер статьи базы знаний

000384974

 
Загрузка
Salesforce Help | Article