How to Make Text Field Required in Salesforce

In this Salesforce tutorial, we will learn how to make the text field required in Salesforce.

For learning this process you have come to the right place and we learned this topic in both the editions of Salesforce Lightning and Salesforce Classic.

How to make text field required in Salesforce Lightning

Here we will learn how to make the text field required in Salesforce Lightning. Let’s take an example to clear our scenario, suppose there is a company and I am working in this company and managing the customer information and feedback by using Salesforce.

The company has a custom object called customer in this custom object we can record the feedback from customers and the custom object customer has a text field called feedback comment where the extra comments are given by the customers, how they experience.

The company wants to make it compulsory for all the customers to give comments after submitting the feedback. For making the text field required make sure that the customer can give a value for that field before the record is saved by them.

Here are the following steps:

1. When we log into the Salesforce account we directly log into the Salesforce Lightning account and here I am working on the Lightning account, so click on the gear icon under this there is a setup option. Click on the setup option, Under the setup there is an object manager tab click on the object manager tab.

How to make text field required in Salesforce

2. The Object Manager tab is open, there are lots of objects present select one of the objects and here we are selecting a customer object from all of these objects.

3. If the customer object is not shown under these lots of objects then enter the customer object in the search box. The customer object comes at the top and selects the customer object.

How to make text field required in Salesforce Lightning

4. The customer object page is open and under this customer page, we can see the details related to the customer, and on the left side, there is a field and relationship option that is present under the detail. Click on this field and Relationships option.

Make text field required in Salesforce

5. The field and relationship page is open. Under this page, we can see the already created field and we want to select the text field here we can see the Feedback Comment field which is the Text field. So click on that field.

Make text field required in Salesforce Lightning

6. The Feedback Comment field page is open and under this page, we can see that the information related to the feedback comment is present and we want to edit this page. So we click on the edit button that is present at the middle of the page.

See also  Salesforce URL Field

7.  The feedback comment field comes into edit mode and we can edit anything on this page. Scroll to the bottom of the page there is a general options section and under this section, there is a required checkbox is present.

8. Checked the required checkbox, the field always requires a value in this field in order to save a record. So making the description requires us to click on the required checkbox and click on the save button.

Salesforce make text field required

9. After clicking on the save button we can see that our custom field feedback comment page is open under this page we can see that the field label, field name, and API name are filled and under the general options section we can see that the required checkbox is also checked. So this required field always requires a value in this field in order to save a record.

Salesforce make text field required

10.  Click on the App Launcher, click on the app launcher, and enter the sales in the search box. The sales come at the top, click on the sales option. The Sales page is open. Under this Sales page, there are lots of objects present on the nav bar and we are selecting one of the objects.

11. Here we are selecting the customer object. The customer record page is opened. Under this page, we can see customer record is saved. We want to create a new record, click on the new button that is present in the right top corner. The new customer dialogue box is open. Here we can fill the information related to the customer.

12. Here we fill in the customer name and then fill the customer feedback description after that fill the feedback comment which is the text field and is the required field where the extra comments are given by the customers about what they experienced and click on the save button.

How to make the text field required in Salesforce

13. After saving the record customer record is created and the detail related to the customer is shown. We can see that the feedback comment field is shown as a text field and here we can enter extra comments given by the customers. This feedback comment can be shown as a details option under the Adolph Mayert JR.

How to make the text field required in Salesforce Lightning

In this way, we understand how to make the text field required in Salesforce Lightning. Let’s Proceed further and learn how to make the text field required in Salesforce Classic.

How to make text field required in Salesforce Classic

Here we will learn how to make the text field required in Salesforce Classic. Let us take an example, there is an organization based in the United States of America that uses salesforce to trace the task and the action items.

See also  How to Make Number Field Required in Salesforce

There is a custom object called task to trace the different tasks that are allocated to the different team members. There is a custom field present under the custom object, the custom field name is task description which is the text field where the user can give additional details about the tasks.

Here we want to make sure that all the tasks have a distinct and detailed description to make easy and effective collaboration. To impose this we decide to make sure that the task description field is required.

Here are the following steps:

1. When we login to the Salesforce account, our Salesforce Lightning account is open but we wanted to work on the Salesforce Classic account so we moved to the Salesforce Classic account. For this click on the profile picture, under this profile picture, there is an option to switch to a Salesforce classic account.

2. Click on the switch to a Salesforce Classic, Our Salesforce Classic org is open. Under this Salesforce Classic org, we can see that the username is present. Click on the drop-down arrow of the username.

3. The drop-down list is open, after clicking on the drop-down arrow. Under this drop-down list, we can see that the Setup option is present. Select the Setup option.

How to make text field required in Salesforce Classic

4. Setup page is open. Under this setup page, we can see on the left side there is Quick Find box is present. Enter the objects in the Quick Find box, the objects come at the top and it is present at the create option.

Make text field required in Salesforce Classic

5. Click on the object, and the custom object page will open. We can see the lots of objects are present that are created by us and here we want to select the task object. Click on the task object.

Salesforce Classic make text field required

6. There is a detail related to the task object. Now scroll to the bottom of the page, we can see there is a section on custom fields and relationships, and under this section, there is a task description field and we want to edit this field to make the field required. Click on the task description field.

How to make the text field required in Salesforce Classic

7. The task description page is open, Scroll to the bottom of the page there is a general options section and under this section, there is a required checkbox is present. Click on the required checkbox, the field always requires a value in this field in order to save a record.

8. So making the task description requires. When we click on the checkbox the dialog box pops up. There is a warning message read the message carefully, the message is making this field required may break the existing API or Apex requests that do not supply a value for this field, and click on the confirm option.

Make the text field required in Salesforce Classic

9. The required checkbox is checked, this always requires a value in this field in order to save a record and click on the save button.

Salesforce Classic make the text field required

10. Here we can see that our custom field definition page is open under this page we can see that the field label, field name, and API name are filled and under the general options section we can see that the required checkbox is also checked. So this required field always requires a value in this field in order to save a record.

How to make a text field required in Salesforce Classic

11. Click on the Home tab, the home page is open and under this home page, there are lots of objects present on the nav bar. Here we are selecting the task object, the task record page is open and here we are creating the new record. Click on the new button.

See also  How to Create Global Picklist Value Set in Salesforce

12. The new task page is open and here we are entering the task name and then the checkbox checked date after that enter the task description and click on the save button.

Make a text field required in Salesforce Classic

13. After saving the salesforce task, the record is created and the detail related to the salesforce task is shown. We can see that the task description field is shown as a text field. All the tasks have a distinct and detailed description to make easy and effective collaboration.

14. We can also edit, delete, clone and share this record by simply clicking on the edit, delete, clone and share button.

Salesforce Classic make a text field required

So with this, we understand how to make the text field required in Salesforce Classic.

Conclusion:

The text field is required to make sure that the customer can give a value for that field before the record is saved them. This is important to store the required information and also conserve the data integrity.

I hope you read the complete article and get the complete idea related to how to make the text field required in Salesforce.  I have also explained all the steps of making the text field required in Salesforce Lightning and Salesforce Classic.

You may like to read: