How to Add Display Format for Auto Number Field in Salesforce

In Salesforce auto number field is a system-generated field that automatically produces a unique identifier for each record. The display format for the auto number field defines how the field value looked when viewed on the record detailed page.

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

Here we will learn how to add the display format for the auto number field in Salesforce Lightning. Let us take a real-life example, Imagine there is a company that sells an electronic gadget online and they setting up the salesforce instance for this electronic gadget company.

Here the company wants to generate the unique order numbers for each purchase that is made by the customers. They want the order number to follow up on the particular format for better organization and tracking. So for this, they add the display format for following the particular format.

Suppose a customer places an order for a smartphone, the order is created in Salesforce. The auto number field generates a unique order ID with a display format and the following format as ORD-100.

By adding the display format to the auto number field, the company can easily identify and track an order within Salesforce.

Here are the following steps

1. Go to the Salesforce account, and click on the setup option that is present under the gear icon. After that select the object manager tab that is present under the setup page on the nav bar.

2. Here we want to select the order object so enter the order in the search box and then select the order object. Here we can see the details related to the object. On the left side of the order object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

How to add the display format for the auto number field in Salesforce

3. The order Fields and Relationships page is open, and under this page lots of fields are present but we want to create a new field for adding the display format for the auto number field. Click on the new button.

4. The data type page is open. Under this page lots of datatypes are present. Here we select the auto number data type, scroll to the bottom of the page, and click on the next button.

5. Now enter the details related to the new order custom field here first enter the field label as Order ID and then display the format as ORD-100 after that fill the starting number and then fill the field name by simply clicking on the field name field and then click on the next button.

How to add the display format for the auto number field in Salesforce Lightning

5. Now establish the field level security, and select the profile to which we want to grant the edit access to this field via field level security. The field will be hidden from all the profiles.

See also  How to Create a Custom Address Field in Salesforce

6. If we do not add it to field level security then check the visible checkbox for the profiles that are added to the field level security and then click on the next button.

 Add the display format for the auto number field in Salesforce

7. Here we are adding the custom field to the page layout, select the page layouts that should involve this field. The field will be added as the last field in the first 2-column section of these page layouts.

8. 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. After that click on the save button.

Add the display format for the auto number field in Salesforce Lightning

9. The Order ID field is created and we come back to our fields and relationships page under this page we can see that the Order ID with auto number data type is placed under this field and relationship page.

10. Go to the App Launcher, enter the sales in the search box and the sales option comes at the top. Select the sales option. The sales page is open and under this sales page, we can see there is more drop-down arrow present.

11. The drop-down list is open and here we are selecting the order tab, the order record page is open and we want to create a new record. For creating the new record click on the new button.

12. The new order dialogue box is open. Now fill in the complete information related to the order. Here we can see the order number field is present but it is view view-only field when we save the record it automatically generates the order number.

13. After that fill in the account name and then fill the Order Start Date after that fill in the order type if you want to fill and then fill the status, and then click on the save button.

Salesforce add the display format for the auto number field

14. After saving the order record, the record is shown under the record page. Click on the record and then click on the detail taband we can see the information related to the order and thn scroll to the botton and here we can see the order id is generated in the format that we are adding. We are adding the display format as ORD-{0000}.

15. Here we get the same format as ORD-0107. This 107 format is shown from the starting number because we add the starting number as 100. so it starts from 100.

Salesforce Lightning add the display format for the auto number field

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

How to add the display format for the auto number field in Salesforce Classic

Here we will learn how to add a display format for the auto number field in Salesforce Classic. Let us take a real-life example, suppose we are arranging the salesforce for the university admission department.

See also  Salesforce Number Field

The university wants to well organize its application process by assigning a unique application number to every student who applies for admission. Additionally, they want the application number to follow a particular format for easy tracking and identification.

When an expected student submits an application form for admission to the university. When the application record is created in Salesforce. The auto number field generates a unique application number following the format APP-200.

As more students apply the salesforce automatically increments the sequential digits resulting in application numbers.

Here are the following steps:

1. Our Salesforce Lightning account is open when we click on the salesforce account. But we want to work on the classic version, so for this, we click on the profile picture and under this profile picture there is an option present switch to Salesforce Classic. Click on this to switch to the Salesforce classic version.

2. Click on the drop-down arrow of the username. The drop-down list is open, after clicking on the drop-down arrow. We can see that the Setup option is present. Select the Setup option.

3. 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, the objects come at the top and it is present at the create option.

4. Our custom object page will open here we can see the lots of objects present that are created by us and here we want to select the application object. Click on the application object.

How to add the display format for the auto number field in Salesforce Classic

5. Our application detail page is open. Now scroll to the bottom of the page and here we can see the custom field section and under this section, we can see some already created fields are present.

6. Here we want to create a new custom field, To create the new custom field we click on the new button. The data type page is open. Under this page lots of datatypes are present. Here we are selecting the currency data type, scroll to the bottom of the page under this page we can see the save button is present.

7. Click on the save button. Now enter the details related to the new order custom field here first enter the field label as application number and then display the format as APP-{000} after that fill the starting number and then fill the field name by simply clicking on the field name field and then click on the next button.

Add the display format for the auto number field in Salesforce Classic

8. Now establish the field level security, select the profile to which we want to grant the edit access to this field via a field level security. The field will be hidden from all the profiles if we do not add it to field level security then check the visible checkbox for the profiles that are added to the field level security and then click on the next button.

Salesforce Classic add the display format for the auto number field

9. Here we are adding the custom field to the page layout, select the page layouts that should involve this field. The field will be added as the last field in the first two-column section of these page layouts.

See also  How to Make Text Field Required in Salesforce

10. 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. After that click on the save button.

How to add display format for the auto number field in Salesforce Classic

11. Our Application number field is created and we come back to our fields and relationships page under this page we can see that the application number with an auto number field is shown.

12. Click on the Home tab, the home page is open and under this home page, there are lots of objects present on the nav bar. Here we are selecting the application object.

13. The application record page is open and here we are creating the new record. Click on the new button. After clicking on the new button the new property page opens and here we are filling in the information related to the property.

14. First, fill the application name as student application and here we are filling the username and then clicking on the save button.

15. After saving the order record, the record is shown under the record page. Click on the record and then click on the detail tab and we can see the information related to the application.

16. After that scroll to the bottom and here we can see the application number is generated in the format that we are adding. We are adding the display format as APP-{000}. Here we get the same format as APP-200. This 200 format is shown because we set the starting number as 200. So that is why it starts from 200.

Salesforce Classic add display format for the auto number field

So with this, we understand how to add the display format for the auto number field in Salesforce Classic.

Conclusion:

I hope you read the complete article and get the complete idea related to how to add the display format for the auto number field in Salesforce.  I have also explained all the steps of adding the display format for the auto number field in Salesforce Lightning and Salesforce Classic.

You may like to read