In this Salesforce tutorial, we will discuss how to create an auto number field type in Salesforce. Auto number field type is picked by a system-generated series number that uses a definite display format we define.
This auto-generated number in Salesforce can be increased for every record we can create. When we create a new record every time, every record is upgraded and displayed under the object.
For example, there is a company that hires a worker that collects the order and makes a bundle of the order and sets the order number for dispatching the order for setting the order number by simply using the auto-generated data type, and this auto-generated number can help the customer to track the order easily.
To set the order number for an order, they first need to create the auto generate number type. So, they use the auto-generate data type that is present under the fields and relationships.
Let’s go into more detail about creating the auto number field type in Salesforce Lightning and Salesforce Classic.
Auto number field type in Salesforce
Auto number field type is a field that is system generated sequence number that is used to show the format you define. After using the auto number is automatically incremented for every new record.
It can be helpful when the users want the records to enter a unique number every time a new record is created, or records need to be tracked by the number.
For example, many contacts is present, and a different record is created every time. For example, An automatically generated unique reference number can be applied to that particular contact, and this is helpful to keep track. Also, if you are integrating another system, it also helps in integration as well.
Now, let’s move further and see how to create the auto number field type in Salesforce Lightning and Salesforce Classic.
Read How to Reset or Restart the Auto Number field in Salesforce
How to create an auto number field type in Salesforce Lightning
Here we are creating an auto number field type in Salesforce Lightning. Here we are taking an example from which the user can easily understand things, there is a USA-based company that hires a worker that collects the order and makes a bundle of the order.
After making the bundle, they give the order number to all the orders, which helps in dispatching the order, and this order number can also help the customer to track the order easily. For setting the order number, use the auto-generated data type and this auto-generated number.
If you want to learn how to create an auto number field type in salesforce lightning, follow these steps:
Step-1: Firstly, log in to the Salesforce Lightning account. After logging into the account, we want to create an auto number field type for this and move to the gear icon(⚙️). After clicking on the gear icon.
The drop-down list of the gear icon is open. Under this gear icon, there are two options. The first one is Setup, and another one is Service Setup. Here we click on the Setup option. After clicking on the Setup option, the Setup page is open.
Under this setup page, the object manager tab is present on the nav bar. Click on the object manager tab.

Step-2: The Object Manager page opens after clicking on the Object Manager. Many objects are present, and we want to select one of the objects. So we enter the opportunity object in the search box, and the opportunity object comes at the top of the page.
After reaching the object at the top, select the opportunity object with API Name as an opportunity and the type as a Standard object.

Step-3: After selecting the opportunity object, the opportunity page is open. Here we can see the details related to the opportunity. And under this opportunity object on the left-hand side of the page, there is a separate section of details, and under these details, there is a field and relationships option.
Here we are selecting this field and relationship option for creating the fields and creating the relationship between the fields and the object.

Step-4: The field and relationship page opens after clicking on the Field and Relationship option. Under this field and relationship page, there are lots of fields present, but we want to create a new field.
So, for creating the new custom field. Click on the new button in the middle of the field and relationship page.

Step-5: After clicking on the new button, the opportunity new custom field page is open. Under this new custom field page, lots of data types are present. Here we can choose the field type.
Specify the type of information that the custom field will contain. Here we are choosing the auto number data type a system-generated sequence number that uses a display format we define, and the number is automatically increasing for each new record. Click on the next button.

Step-6: After selecting the auto number data type, the opportunity new custom field is open, and here we enter the details. Firstly enter the field label, and here we are entering the field label as Opportunity Number after that fill the display format, and here we are filling the format as Opp-{0000}, and then fill the starting number as 1.
After filling in the starting number now check the checkbox to generate an auto number for existing records, and after that fill in the field name. But this field name is automatically filled by simply clicking on the field name. After filling in the complete detail, click on the next.

Step-7: After filling the complete detail now, established the field-level security. Select the profiles we want to grant edit access to this field via field-level security.
The field will be hidden from all profiles if we do not add to it field-level security. Click on the visible checkbox of the field-level security for the profile and then click on the next button, which is present near the previous option.

Step-8: After establishing the field-level security. Now we can add the page layout. Select the page layouts that should include this field. The field will be added as the last field in the field two-column section of these page layouts.
This field will not appear on any pages if you do not select a layout. To change the location of this field on the page, we will need to customize the page layout. Click on the save button.

Step-9: The auto number custom field is created successfully after clicking on the save button. Now click on the app launcher, and enter the sales in the search box. The sales page is open. Under this sales page, there are lots of objects present on the nav bar.
Select one of the objects, and here we are selecting the opportunity object after selecting the opportunity object. The opportunity page is open. Under this opportunity page, there are lots of records.
Here we are selecting the one record that is card item detail, the opportunity card item detail page is open. Under this record, we can see that the opportunity number field is created, and the number is automatically generated.

This way, we understand how to create the auto number field type in Salesforce Lightning. Let’s Proceed and learn how to create the auto number field type in Salesforce Classic.
Read How to Change the Format of Auto Number Field on Existing Record in Salesforce
How to create an auto number field type in Salesforce Classic
Here we are creating the auto number field type in Salesforce Classic. Now take an example in which we take and contact object, and there are lots of contact present, and every time a different record is created. For example,
An automatically generated unique reference number can be applied to that particular contact, and this is helpful to keep track. Also, if you are integrating another system, it also helps in integration as well.
If you want to learn how to create an auto number field type in salesforce classic, follow these steps:
1: To create the auto number, we first logging the Salesforce classic account, but when we log in to the Salesforce account, we first enter into the Salesforce lightning account. But we want to move to the classic account.
To move to the classic account, click on the profile picture. After clicking on the profile picture, the drop-down menu is open. Under this drop-down menu, there is a switch to the Salesforce classic option is present.
Click on the Switch to Salesforce Classic option, the Salesforce Classic edition is open. Now we can create the auto number field type in Salesforce Classic.
So first click on the username drop-down arrow, and the username drop-down list is open. Under this list lots of options are present. Now click on the setup option.

2: After clicking on the Setup option, the Setup page is open; under this setup page, there is Quick Find Box; enter the contact in this Quick Find box. The Contact object comes at the top. Click on the drop-down arrow of the contact object.
The drop-down list is open, Under this contract drop-down list, there is a fields option. Click on the fields option.

3: After clicking on the Contact object, the Contact custom object page is open. Now scroll to the bottom of the page and see the contact custom field and relationships section here.
And we want to create a new custom field related to the contract by simply clicking on the new button.

4: The new custom field page is open after clicking the new button. Here we can choose the field type by specifying the type of information that the custom field will contain. And we are choosing the field as an auto number by simply clicking on the checkbox.
Here we are selecting the formula field. After selecting the formula field, Click on the next button.

5: After selecting the auto number data type, the contact new custom field is open, and here we enter the details. Firstly enter the field label, and here we are entering the field label as a Unique ID after that, fill the display format, and here we are filling the format as UNQ-{0000} and then fill the starting number as 1.
After filling in the starting number now, check the checkbox to generate an auto number for existing records, and after that fill the field name. But this field name is automatically filled by simply clicking on the field name. After filling in the complete detail, click on the next.

6: After filling the complete information related to the auto number field, Now established the field-level security after creating the formula. Select the profiles we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.

7: After adding the field-level security for the profile, we can now add it to the page layout. Select the page layouts that should include this field.
The field will be added as the last field in the field two-column section of these page layouts. This field will not appear on any pages if you do not select a layout.
To change the location of this field on the page, we will need to customize the page layout. Click on the save button.

8: After saving the unique id auto number field type, the unique id auto number field is created successfully. To see whether the auto number is generated or not. We again click on the contact object.
After clicking on an object, the object page is open; under this object there are many objects and we click on the Dr. Rosalyn Jaskolski contact, the Dr. Rosalyn Jaskolski contact page is open.
This contact page shows that the unique id is automatically generated and present under the contact detail.

So, with this, we have learned, how to create the auto number field type in Salesforce Classic.
Conclusion
This Salesforce auto number is a system-generated sequence number that shows the format we can define to make a field. After creating the field, when we created the new record, the number of the auto number field is automatically incremented for every new record.
I hope you read the complete blog and you have learned how to create the auto number in Salesforce. This auto number field helps generate a sequence number. And I have also explained all the steps of formula field type in Salesforce Lightning and Salesforce Classic.
You may also like:
- Create Formula Field Type in Salesforce
- Edit Fields Inline on the Report Page in Salesforce
- Create Lookup Relationship Field Type in Salesforce
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.