How to Make Number Field Unique in Salesforce

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

Here we will learn how to make the number field unique in Salesforce Lightning. So let us take an example, Suppose there is a company that sells products and I am working in this company as a product in charge and it’s my duty to check no product has the same product code.

The company also wanted each product to be assigned by a unique product code that is represented by a numeric identifier, for this the company uses Salesforce and in Salesforce we have a custom object called product and inside this field, there has a custom field called product code.

Now we want to make sure that no products have the same product code to avoid that type of confusion and maintain the accurate record. Here we can make the number field unique

Follow the following Steps:

1. Click on the Salesforce lightning account, our Salesforce Lightning org is open, and we want to make the number field unique. For this, we can click on the setup option that is present under the gear icon.

2. The setup page is open, Under this Setup page there is the Object Manager tab present click on the object manager tab. The Object Manager page opens and under this Object Manager tab, lots of objects are present.

3. Here we are entering the product in the search box. The product object comes at the top after searching for the object in the search box. click on the product object. Under this page, we can see the details related to the object.

How to make the number field unique in Salesforce

4. On the left side under the detail section of the product object page, we can see the Fields and Relationships option is present. Click on the Fields and Relationship option.

5. After clicking on the Fields and Relationships option, the Fields and Relationships page is open. Under this page, we can see that lots of fields are already created. We want to select the product code field because we make this field unique.

How to make the number field unique in Salesforce Lightning

6. Click on the product code field and our product code page is open we want to edit this field that’s why we want to click on the edit button. Our product code field comes into the edit mode and here we can edit anything.

7. Scroll to the bottom of the page and here is the general options section under this section we can see there are lots of checkboxes present but we want to make this product code field unique. So that is why we click on the unique checkbox.

See also  How to Set Default Value for Email Field in Salesforce

8. This unique checkbox does not allow duplicate values, if the duplicate value comes it shows the error. Click on the save button.

Make the number field unique in Salesforce

9. After clicking on the save button we can see our product code detail page is open here we can see that the detail related to the product code and there is a general options section and under this section, we can see there is a unique checkbox is present which is checked and which make this custom field unique.

Make the number field unique in Salesforce Lightning

10. Click on the App Launcher, click on 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. 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.

12. The product record page is open and under this page, we can see the already created record but we want to create a new record. So click on the new button. The new product dialogue box is open.

13. Fill the complete information related to the product, first fill the product name and then fill the product time after that fill the product price and then fill the product code. Here we fill the same product code that is already present and hit the save button.

14. After hitting the save button it shows the error that reviews the errors on this page. Duplicate value found. Now check the error and resolve it.

Salesforce make the number field unique

15. Now we change the product code set the unique product code and then hit the save button. Now we can see that our record is saved and shown on the record page and the detail related to the sales product is shown under this sales product record page.

Salesforce lightning make the number field unique

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

How to make the number field unique in Salesforce Classic

Here we will learn how to make the number field unique in Salesforce Classic. We take an example to clear our scenario, There is a company that uses the salesforce and there are lots of employees that are working in this company. To remember every employee by their name the company decided to give the unique id to every employee.

It is also easy for the manager when they pay the salary in the account they only type the employee ID because the ID of every employee is unique but the names of two employees are the same at that moment.

See also  How to deactivate picklist value in Salesforce

In the salesforce, there is a custom object present that is an employee and under this object, there is a custom object present that is an employee ID and the company gives every employee the unique employee ID if they get the same employee ID by mistake then it gets an error.

Now let us see how we can make the employee id unique which is the number field in Salesforce.

Follow the following steps:

1. Click on the Salesforce account and our Salesforce Lightning account is open but we wanted to work on the Salesforce Classic version to move to the Salesforce Classic account.

2. For this click on the profile picture, under this profile picture, there is an option to switch to a Salesforce classic account.

3. lick 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.

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

5. The 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. Our custom objects page is open and under this custom object page, the employee object is present. Click on the employee.

How to make the number field unique in Salesforce Classic

6. The employee page is open and under this page, we can see the details related to the employee and we scroll to the bottom of the page, There are fields and a relationship section is present.

7. Under this section we can see there is employee ID field is already present. Click on this field and we can see the details related to this employee ID field we want to edit this field to make this field unique so click on the edit button. So click on the edit button

8. Now our employee ID field is ready to edit so we can edit anything now scroll to the bottom of the page we can see there is a general options section present, and under this section, we can see that there is a unique checkbox present, To make our field unique we click on the unique checkbox.

9.This unique checkbox field refers to the field that applies the uniqueness among the values that we enter in the field and that stores it as a record in a specific object.

10. It does not allow duplicate values and after making the text field unique click on the save button. After clicking on the save button, we can see that our employee id field is unique.

Make the number field unique in Salesforce Classic

11. We come back to the employee fields and relationships page and we can see that our unique checkbox is checked and that It does not allow duplicate values after making the number field.

See also  How to Make Percentage Field Required in Salesforce

12. Go to the home tab, and under this home tab, we can see lots of tabs are present on the nav bar. Here we are selecting the employee object from the nav bar, the employee object page is open and under this object, we can see the records are present that are already present.

13. Here we we are creating a new record so we click on the new button. The new employee page is open and under this page, we can see the information related to the employee.

14. First, fill in the employee name and then fill in the employee ID, and then fill in the pin, and then fill in the price after that fill in the identification number, and after that fill in the employee notes field, and then click on the save button.

15. After hitting the save button it shows the error that reviews the errors on this page. Duplicate value found. Our employee ID field is duplicate because we fill the same employee ID of two employees. Now check the error and resolve it.

How to make number field unique in Salesforce Classic

16. Now we change the employee id set the unique employee id and then hit the save button. Now we can see that our record is saved and shown on the record page and the detail related to the Salesforce Employee is shown under this Salesforce Employee record page.

17. Here we can edit, delete, clone, and share the employee record by simply clicking on this edit, delete, clone, and share button.

Make number field unique in Salesforce Classic

So, with this, we have learned how to make the number field unique in Salesforce Classic.

Conclusion:

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

You may like to read