Loading

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

Julkaisupäivä: Apr 3, 2026
Kuvaus

There are multiple ways to make custom fields required. We'll provide some information on each option available.

Ratkaisu

 

Salesforce provides four ways to make a custom field required, each with different scope and behavior. 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 page-specific requirements.

Field level requirements

This is the most restrictive of requirements, and it requires the field to be entered all the time, regardless of how the record is saved (i.e. through an integration, the API, mass upload, or through the User Interface). Read through these instructions for more information.

Require Field Input to Ensure Data Quality
Custom Field Attributes


In Salesforce Classic


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

In Lightning Experience

  1. Click on 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 on Edit and under General Options select Required.
  5. Click on Save.
 

On the page layout

This option only makes the field required when the specific page layout that you set this requirement on is accessed. Therefore, you could technically make this required for some Users that use a particular page layout but not others. Please review, Customize Page Layouts with the Enhanced Page Layout Editor

Note:  This requirement only applies when the record is edited on the user interface. When records are updated via API field requirement does not apply. 

In Salesforce Classic
 

For custom object:
  1. Click on Setup.
  2. Go to Quick Find and enter Object.
  3. Choose the object
  4. Under the Page Layouts section, Click on 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 on Ok, then click on Save.

 

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


In Lightning Experience

  1. Click on 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 on the wrench icon beside the custom field that you will make required.
  5. Select the Required checkbox.
  6. Click on Ok, then click on Save.

 

Validation rule requirement

The simplest validation rule to make a custom field required looks like this:

ISBLANK(Enter_Custom_Field_API_Name_Here__c)


Or, if the field is a Number or Currency type field use this syntax:

ISNULL(Enter_Custom_Field_API_Name_Here__c)

 

You can build more complex validation rules that have conditional statements to meet your business needs. Please review Define Validation Rules.


Note: Like the field level setting, this will apply all the time, regardless of where the record is created or updated. Read Validation Rule Considerations to know what impact this will have. 

In Salesforce Classic

For custom object:

  1. Click on Setup.
  2. Go to Quick Find and enter Object.
  3. Choose the object.
  4. Under the Validation Rules section, click on 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 on Save.

For standard object:
  1. Click on Setup.
  2. Under Build section, click the dropdown button for Customize.
  3. Click the dropdown button for the object and click on Validation Rules.
  4. Click on 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 on Save.


In Lightning Experience

 

  1. Click on the gear icon then Setup > Object Manager.
  2. Choose the object > Validation Rules.
  3. Click on 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 on Save.

 

Dynamic Forms

Dynamic Forms can be used to create Required fields on New and Edit Modals, as well as Lightning Record Pages.  Please review, 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 on gear icon then Edit Page on a sample record or enter 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 on Save (and Activate if necessary).


 
Lisäresurssit

See also:  

Create Custom Fields
Conditionally make a field required    

 

Knowledge-artikkelin numero

000384974

 
Ladataan
Salesforce Help | Article