In this Salesforce tutorial, we will learn how to make the text field type in Salesforce. The unique text 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. When we enter the value in the field we make sure that no two records in that object can have the same value in this record.
Let’s take an example to clearly understand things, There is a software company that sells many things and one of the things is software licenses that they sell to various customers that want to make sure that every customer has a unique customer ID for managing and tracking their customer data.
For this, they have a customer custom object that stores the customer information and inside this object, they have a text field customer ID we make this field unique for this we edit this field and under this custom field detail related to this field is open and here we can see there is a unique checkbox that makes our customer id unique.
If you want to learn the process of how to make text field type unique in Salesforce you have come to the right place and we learn this topic in both the editions in Salesforce Lightning and Salesforce Classic.
How to make the text field type unique in Salesforce Lightning
Here we will learn how to make the text field type unique in Salesforce Lightning. Let’s take an easier example to clearly understand the scenario, Suppose there is a university that is based in the United States of America and this university uses the salesforce to manage the student records.
In this university, there a academic teams that want to make sure that every student has a unique student ID for tracking the academic processes and enrollments. The University has a custom object called student and they want to make the Student ID field unique.
If you want to learn how to make the text field type unique in Salesforce Lightning, follow these steps:
Step-1: Enter the credentials to log into the Salesforce account, First enter the username and then enter the password we directly logged in to the Salesforce Lightning account.
here we make the text field unique for this, We can click on the gear icon that is present at the top right corner, and under this gear icon, there are two options. The first one is Setup and the other one is service setup. Click on the Setup option, after clicking on the Setup option.

Step-2: After clicking on the setup the setup page is open, Under this page we can see that the two tabs are present on the nav bar. The First tab is a Home tab and the other tab is the Object Manager tab. Click on the Object Manager tab.

Step-3: The Object Manager page opens after clicking on the Object Manager tab. Under this object manager tab, lots of objects are present, Select one of the objects from the lots of objects If the object is not shown which you want to choose enter the object name in the search box and here we are entering the student in the search box.
The student object is already present at the first number, if the object is not present at the top after searching the object the object comes at the top we search in the search box, and select the student object from the object manager page.

Step-4: When we click on the Student object, the student object page is open. We can see the details related to the object. And on the left side of the Student object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

Step-5: After clicking on the Field and Relationship option of the student object, The student Fields and Relationships page is open, and under this fields and relationships page we can see that there is a Student ID text field type that is already created. To make the text field type unique, click on the unique checkbox, and click on the Student ID text field type field.

Step-6: After clicking on the Student ID, the Student custom field Student ID page is open. Under this page, we can see the field information related to the Student ID and we want to edit this field information to make this text field type unique. Click on the edit button that is present in the middle of the page.

Step-7: After editing the student custom field student ID, the student ID text field type page opens in the dited mode. Here we can edit the value that is present on the student ID page, we scroll to the bottom of the page.
We can see the general options section and under this section, there is a unique checkbox option. To make our field unique we click on the unique checkbox. 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. It does not allow duplicate values and after making the text field unique click on the save button.

Step-8: After clicking on the save button, we can see that our Student ID field is unique and under the general options section we can see that our unique checkbox is checked and that It does not allow duplicate values after making the text field.
When creating a record of a student and by mistake two record of the same ID is entered they show the error that the duplicate records.

In this way, we understand how to make the text field type unique in Salesforce Lightning. Let’s Proceed further and learn how to make the text field type unique in Salesforce Classic.
How to make the text field type unique in Salesforce Classic
Here we will learn how to make the text field type unique in Salesforce Classic. For example, there is a retail company that uses Salesforce to manage its catalog of electronic products and they want to make sure that the product that is present in the catalog has a unique serial number that can help in tracking the stock level.
For this, they created a catalog called product and this catalog stores the product information and they want to make the serial number unique.
If you want to learn how to make the text field type unique in Salesforce Classic, follow these steps:
Step-1: When we log in to our Salesforce account we directly jump to our Salesforce Lightning version but we want to work on Salesforce Classic. So for moving to the Salesforce Classic version.
Click on the profile picture that is shown in the right top corner. The Profile picture drop-down menu is open, under this drop-down menu, there is an option to switch to the Salesforce Classic version. Click on the switch to the Salesforce Classic version. Our Salesforce Classic org is open.
Under this classic org we can see that the username is present at the top of the page. Click on the drop-down arrow of the username. After clicking on the drop-down arrow the drop-down list is open. Under this drop-down list, we can see that the Setup option is present. Select the Setup option.

Step-2: After clicking on the Setup option that is present under the username, The Setup page is open. Now scroll to the bottom of the page, On the left side we can see that there is a Quick Find Box, Enter the Product object.
The products object comes at the top, click on the drop-down arrow of the products object. Under this drop-down list, there are field options. Click on the Fields.

Step-3: The product page opens, After clicking on the product object. Now scroll to the bottom of the product page, There are fields and relationship options present click on this field and relationship option.
After clicking on the field and relation option, the field and relationship page is open. Here we can see that there is a Serial number text field type that is already created. To make this serial number text field unique, we click on the edit option of the serial number field.

Step-4: After clicking on the edit option of the serial number, the serial number custom field page is open. Scroll to the bottom of the page, and we can see the general options section and under this section, there is a unique checkbox option.
To make our field unique we click on the unique checkbox. 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. It does not allow duplicate values and after making the text field unique click on the save button.

Step-5: After clicking on the save button, we can see that our Serial Number field is unique we come back to the product 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 text field.
When creating a record of a student and by mistake two record of the same ID is entered they show the error that the duplicate records.

So, with this, we have learned how to make the text field type unique in Salesforce Classic.
Conclusion:
In this whole blog, we have learned how to make the text field type unique by simply choosing the object and selecting the text field that is present under the object, We make the text field unique we editing this field and clicking on the checkbox of unique field that is present under the general option. After clicking on the unique checkbox our text field becomes unique.
I hope you read the complete article and get the complete idea related to how to make the text field type unique in Salesforce. I have also explained all the steps of making the text field type unique in Salesforce Lightning and Salesforce Classic.
You may like to read
- How to Change Text Field Length in Salesforce
- Convert Text to Number Field Type in Salesforce
- Salesforce Case Insensitivity For text Field Type
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.