How to Make Number Field Required in Salesforce

In this Salesforce tutorial, we will learn how to make the number 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 the number field required in Salesforce Lightning

Here we will learn how to make the number field required in Salesforce Lightning. Let us take a real-life example, Suppose there is a retail company that uses the salesforce and I am working in this company and manage all the prices related to the products.

For that, all the company members discussed making the product price field for the products required. If any product agent comes and sells the product they fill the complete information related to the product and also fill in the correct price of the product.

This makes it easy for the company to sell this product to the customer without discussing the price again to the buyer team like what price do you buy this product.

For this, I am using the salesforce and choosing the custom object called product, and inside the custom object we see there is a custom field presenting product price which is a number field. This product price represents the price of the product, and we make this field required.

Follow the following steps:

1. Go to the Salesforce lightning account, and then select the setup option this setup option is present under the gear icon. Our Setup page is open.

2. Under the setup page there is an object manager tab is present. Click on this object manager tab. Under the object manager page, lots of objects are present and we are selecting the custom object product.

How to make the number field required in Salesforce

3. The product detail page is open, on the left side of the page we can see there is a field and relationships option. The fields and relationship page is open inside this page we can see lots of fields are already created and here we are selecting the number field which is the product price.

How to make the number field required in Salesforce Lightning

4. The Product price page is open and under this page, we can see that the information related to the product price is present and we want to edit this page. So we click on the edit button. The product price field comes into edit mode and we can edit anything on this page.

5. 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 checked required checkbox field, this field always requires a value in this field in order to save a record. 

Make the number field required in Salesforce

6. So making the product price number field requires, for that click on the required checkbox and click on the save button. After clicking on the save button we can see that our custom field product price page is open under this page we can see that the field label, field name, and API name are shown as filled.

See also  Manage Territories and Territory Models for Opportunities in Salesforce

7. Scroll to the bottom of the page and under the general options section we can see that the required checkbox is also checked and below this required checkbox there is a default value field is also present that is not filled. So this required field always requires a value in this field in order to save a record.

8. 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.

9. If the object is not shown on the nav bar click on the More drop-down arrow and under this More drop-down list, we can see lots of objects present. Click on the product object.

10. The product record page is opened. Under this page, we can see product record is saved. If you want to create a new record, click on the new button. The new product dialogue box is open. Here we can fill in the information related to the product.

11. Here we fill in the product name and then fill the type and then fill the product time, and then fill in the profit margin, and then fill product price which is the required field if we leave this filled empty it shows the error.

12. So don’t leave this field blank fill in this product price field which is a required field and click on the save button our Salesforce Product record is created the details related to the Salesforce product are shown and our product price field is also shown under the detail section.

Salesforce make the number field required

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

How to make the number field required in Salesforce Classic

Here we will learn how to make the number field required in Salesforce Classic. Let us take an example to clear our scenario, Suppose there is a company that has lots of employees and I am the manager of the company, and it’s my duty to manage all the teams that are working on the projects and it’s my duty to give an estimated hour for each task.

Here we are using the salesforce and choosing the project custom object and under this object there is a field presented that estimates hours for each task to help with project planning.

See also  How to Make Percentage Field Required in Salesforce

This Task Estimated hour field is used when the task manager creates or updates a project task it’s the manager’s duty to give a value for the task estimated hours. If any of the members that work on a project or the manager can try to save the record without entering the estimated hour’s value then the salesforce will show the error message.

Here are the following steps

1. Go to the Salesforce account, our lightning version is open but we want to work on the classic version so for this click on the profile picture, and under this profile picture, there is an option to present a switch to Salesforce classic. Click on the switch to the Salesforce Classic version.

2. Click on the drop-down arrow of the username. 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.

3. 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. Click the object option.

4. Our custom object page will open here we can see the lots of objects present that are created by us and here we want to select the project object. Click on the project object. On this page, we can see the details related to the project object.

How to make the number field required in Salesforce Classic

5. Now scroll to the bottom of the page and here we can see the custom field section under this section, we can see some fields present that are already created by us. From these fields, I selected the Task estimated hour field and made this task estimated hour required.

Make the number field required in Salesforce Classic

6. The task estimated hour custom field page is open and here we can see the details related to the task estimated hour custom field, scroll to the bottom of the page we can see there is a general options section present.

7. Under this section we can see the required checkbox is present which makes our field required and the default value field present. Here we click on the required checkbox after clicking on the checkbox.

8. The warning message pops up that is a warning: Potential Integration Impact that makes this field required may break the existing API or Apex requests that do not supply a value for this field after reading the message carefully click on the confirm button.

Salesforce Classic make the number field required

9. After clicking on the confirm button, we can see that our required field is checked. That always requires a value in this field in order to save a record and that required field is present under the general options section and after checking the checkbox is checked click on the save button.

How to make number field required in Salesforce Classic

10. After clicking on the save button we can see our task estimated hour custom field page is open here we can see the details related to this field and when we scroll to the bottom we can see under the general options we can see our required field is checked.

Make number field required in Salesforce Classic

11. Go to the Home tab, and under the home tab we can see lots of tabs are present on the nav bar here we click on the project tab, and our project object page is open. Under this page, we can see project record is saved. 

See also  How to Make Lookup Relationship Field Filter Type Required in Salesforce

12. If you want to create a new record, click on the new button. The new project dialogue box is open. Here we can fill in the information related to the project. Here we fill in the project name and then fill the project status after that fill the project task start time and then fill the project completion and after that fill the task estimated hours.

13. If we leave the task estimated hours field empty then the salesforce generates an error that is shown at the top of the page and under the task estimated hours field.

14. So don’t leave this field blank fill this task’s estimated hours field which is a required field and click on the save button.

15. Our Salesforce project task record is created and the detail related to the Salesforce project task is shown and our task estimated hours field is also shown under the detail section. Here we can see the task estimated hours are filled.

Salesforce Classic make number field required

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

Conclusion:

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

You may like to read: