How to Set Starting Number for Auto Number Field in Salesforce

In Salesforce the starting number for the auto number field is the initial value is the starting value assigned to the field when a record is created. In Salesforce the Auto Number field are special field that automatically generates a unique identifier for each record in an object.

In this Salesforce tutorial, we will learn how to set the starting number for the auto number field 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 set the starting number for the auto number field in Salesforce Lightning

Here we will learn how to set the starting number for the auto number field in Salesforce Lightning. Let us take a real-life example, suppose there is a company that sells the product and I am working in this company as an employee.

We are setting up a Salesforce database for a small business that can help the company sell its products online. Here we are selecting the custom object called order that can track the orders from customers.

Each order should have a unique order number that starts from a particular number like 1000 and this number is set in the starting number field.

Here are the following steps

1. Open the Salesforce Lightning account. Click on the gear icon that is present at the top right corner, and then click on the Setup option.

2. Under this Setup page there is the Object Manager tab present click on the object manager tab. Select the order object, under this order page, we can see the details related to the order object.

How to set the starting number for the auto number field in Salesforce

3. We can see the Fields and Relationships option is present. Click on the Fields and Relationship option. We can see lots of fields are already created but we want to create a new field.

4. So click on the new button, our data types page is open and we can see lots of data types are present here we select the auto number field and then click on the next button. Our order page is open.

5. Under this page we can see the information related to the order fill in all the information carefully. First, fill in the field label as Order Number and then fill the display format as ORD-{0000} after that fill the starting number, and this number is set in the starting number field.

6. After that check the generate auto number for existing records checkbox that generates the number automatically and then fill the field name by simply clicking on the field name field and the field is automatically filled, after that click on the next button.

How to set the starting number for the auto number field in Salesforce Lightning

7. Now we move to our next step which is to establish field-level security that can select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all the profiles if we do not add it to field-level security and then click on the next button.

Set the starting number for the auto number field in Salesforce

8. Here we want to add this field to the page layout. Select the page layouts that should involve this field. This field will be added as the last field in the first 2-column section of these page layouts.

See also  How to Add Validation Rule for Phone Field in Salesforce

9. The field will not appear on any pages if we do not select a layout. To change the location of this field on the page, we will need to customize the page layout and then click on the save button.

Set the starting number for the auto number field in Salesforce Lightning

10. After clicking on the save button we come back to our field and relationship page. Here we can see our order number field is created and it is an auto number data type.

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

12. Here we are selecting the order object. The order object record page is open. Here we we are creating a new record so we click on the new button.  First, fill in the Account name then fill in the type, and then fill in the order start date.

13. After that fill in the contract number and then fill the status and then we can see that there order number is present but there is no field present to enter when we save this record the order number is automatically generated.

14. Here we are setting the starting number for the order number is 1000. Click on the save button.

Salesforce set the starting number for the auto number field

15. Our order 00000106 record is created successfully and under this record, we can see that there is an order number field present, and its number starts from 1000 and the product order number is 10006.

Salesforce Lightning set the starting number for the auto number field

In this way, we understand how to set the starting number for the auto number field in Salesforce Lightning. Let’s Proceed further and learn how to set the starting number for the auto number field in Salesforce Classic.

How to set the starting number for the auto number field in Salesforce Classic

Here we will learn how to set the starting number for the auto number field in Salesforce Classic. Let us take an example, there is a company that sells books and in this company, they want an employee that manages their library, So they hire an employee for this.

See also  Salesforce Time Field

After hiring the employee they tell them to manage their library. So for this, they use the database for managing the small library. Track each book in our collection with a unique identifier starting from a particular number and this particular number starts from 2000.

Follow the following steps:

1. Click on the Salesforce, our Salesforce Lightning account is open. We want to work on the 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. Under this drop-down list, we can see that the Setup option is present. Click on the Setup page. 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 and our custom object page is open.

4. Here we are selecting the book object. Here we can see the details related to the book and then scroll to the bottom we can see there is a book custom fields and relationships section.

How to set the starting number for the auto number field in Salesforce Classic

5. Under this section, we can see that lots of field is already created and present under the field and relationship section. But we want to create a new book ID field, To create this click on the new button.

6. Our data types page is open and we can see lots of data types are present here we select the auto number field and then click on the next button. Our book page is open. Under this page, we can see the information related to the book fill in all the information carefully.

7. First, fill in the field label as Book Id and then fill the display format as BOOK-{0000} after that fill the starting number, and this number is set in the starting number field. After that check the generate auto number for existing records checkbox that generates the number automatically and then fill the field name after that click on the next button.

Set the starting number for the auto number field in Salesforce Classic

8. Now we move to our next step which is to establish field-level security that can select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all the profiles if we do not add it to field-level security and then click on the next button.

Salesforce Classic set the starting number for the auto number field

9. Here we want to add this field to the page layout. Select the page layouts that should involve this field. This field will be added as the last field in the first 2-column section of these page layouts. The field will not appear on any pages if we do not select a layout.

See also  How to Set the Length and Decimal place for Percentage field in Salesforce

10. To change the location of this field on the page, we will need to customize the page layout and then click on the save button. After clicking on the save button we come back to our field and relationship page. Here we can see our book ID field is created and it is an auto number data type.

How to set starting number for the auto number field in Salesforce Classic

11. 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 task object from the nav bar, the book object page is open and under this object, we can see the records are present that are already present.

12. Here we are creating a new record so we click on the new button. The new book page is open and under this page, we can see the information related to the product. Fill the book name and then fill the USA Student if you want otherwise leave it the same and click on the save button.

Set starting number for the auto number field in Salesforce Classic

13. After filling all the book information, our Salesforce developer book details related to the book are created and shown under the Salesforce developer book page. Here we can see there is a book ID field present, and its number starts from 2000 and the book ID number is 2001.

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

Salesforce Classic set starting number for the auto number field

So with this, we understand how to set the starting number for the auto number field in Salesforce Classic.

You may like to read: