How to Create Auto Number Field Type in Salesforce

Auto number field type in Salesforce is picked by a system-generated series number that uses a definite display format we define.

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

Let’s consider a scenario: there is a company that hires a worker that collects the order, 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-generated 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

The auto number field type is a field that uses a system-generated sequence number to show the format you define. After using the auto number, it 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 are present, and a different record is created every time. An automatically generated unique reference number can be applied to that particular contact, which is helpful for keeping track. Also, if you are integrating another system, it 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.

See also  Configure Dashboard Data Visibility in Salesforce

Consider a scenario from which the user can easily understand things; there is a USA-based company that hires a worker to collect the order and make 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.

1. Log into your Salesforce account –> Click on the gear icon –> Select the Setup option –> Click on the Object Manager tab.

How to create an auto number field type in Salesforce

2. Now, enter the opportunity object in the search box and click the opportunity object, which is the standard object.

How to create an auto number field type in Salesforce Lightning

3. Here, select the Fields and Relationships that are present under the details sidebar.

Create an auto number field type in Salesforce

4. Here, we can see lots of fields are already created, but we want to create a new field. Click on the new button.

Create an auto number field type in Salesforce Lightning

5. Here, we are selecting the auto number data type, a system-generated sequence number that uses a display format we define. The number automatically increases for each new record. Click on the next button.

Salesforce create an auto number field type

6. Now enter the details; fill in the field label as Opportunity Number. After that, fill the display format as Opp-{0000}, and then fill the starting number as 1. Now check the checkbox to generate an auto number for existing records, and after that, fill in the field name. Click on the next button.

Salesforce Lightning create an auto number field type

7. Now, establish the field-level security. Select the profiles we want to grant edit access to this field via field-level security. Click on the visible checkbox of the field-level security for the profile and then click on the next button.

How to create auto number field type in Salesforce

8. 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. Click on the save button.

How to create auto number field type in Salesforce Lightning

9. Now click on the App Launcher and enter sales in the search box. The sales page will open. Under this sales page, the nav bar will contain many objects.

See also  How to Create a Checkbox Field in Salesforce

Select one of the objects. Here, we are selecting the opportunity object. The opportunity page is open. Under this opportunity page, there are many records.

Here, we are selecting the card item detail record. Under this record, we can see that the opportunity number field is created, and the number is automatically generated.

Create auto number field type in Salesforce

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 a contact object, and there are lots of contacts present. Every time a different record is created, an automatically generated unique reference number can be applied to that particular contact, which is helpful for keeping track. It also helps if you are integrating another system.

Here are the following steps:

1. Login into the Salesforce Account –> Click on the Profile Picture –> Select the Switch to Salesforce Classic option –> Click on the username drop-down arrow –> Select the Setup option.

How to create an auto number field type in Salesforce Classic

2. Now, enter the contact in the search box and click on the contact drop-down arrow. The drop-down list list is open and select the fields option.

Create an auto number field type in Salesforce Classic

3. Now scroll to the bottom of the expense page; there is the Custom Fields and Relationships section. There are lots of fields that are already created, and we want to create a new field. Click on the new button.

Salesforce Classic create an auto number field type

4. The data type page is open. Here, we select the Auto Number data type and click on the next button.

How to create auto number field type in Salesforce Classic

5. Now enter the details. Fill the field label as Unique ID. After that, fill in the display format as UNQ-{0000} and then fill the starting number as 1. Now, check the checkbox to generate an auto number for existing records, and after that, fill in the field name. Click on the next.

Create auto number field type in Salesforce Classic

6. Now, establish the field-level security. Select the profiles to which we want to grant edit access to this field via field-level security. If we do not add field-level security, the field will be hidden from all profiles. Click on the next button.

Salesforce Classic create auto number field type

7. After adding the profile’s field-level security, we can add it to the page layout. Select the layouts that should include this field. We will need to customize the page layout to change the location of this field on the page. Then, click on the save button.

How to create a auto number field type in Salesforce Classic

8. Here, we want to see whether the auto number is generated; we click on the contact object. The contract record page is open; under this, there are lots of records present; here, we click on the Dr. Rosalyn Jaskolski contact.

See also  How to Convert Text to Number Field Type in Salesforce

This contact page shows that the unique id is automatically generated and present under the contact detail.

Create a auto number field type in Salesforce Classic

So, with this, we have learned how to create the auto number field type in Salesforce Classic.

Conclusion

I hope you read the entire article and get a clear idea of how to create an auto number field in Salesforce.

I have also explained all the steps for creating an auto number field in Salesforce Lightning and Salesforce Classic.

You may also like: