How to Set Default Value for Number Field in Salesforce

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

Here we will learn how to set the default value for the number field in Salesforce Lightning. Let us take a real-life scenario, suppose there is a company that sells products and I am the manager of the company, and it is my duty to handle all the expenses of products for the company.

Here I am using the custom objects that are expenses that can track the various expenses for a company. In this object, there is a custom number field called amount present that can represent the expense amount. We want to set the default value for the amount field to be $200 this amount field is a number data type field.

Here are the following steps:

1. Go to the Salesforce account, our Salesforce Lightning org is open, and we set the default value for the number field. For this, we can click on the gear icon that is present at the top right corner, click on the gear icon, and then click on the Setup option.

2. After clicking on the Setup option, the setup page is open, Under this Setup page there is the Object Manager tab present click on the object manager tab. The Object Manager page opens, after clicking on the Object Manager tab. Under this object manager tab, lots of objects are present.

3. Here we are entering the expense in the search box. The expense object comes at the top after searching for the object in the search box. click on the expense object.

How to set the default value for the number field in Salesforce

4. The expense object page is open. Under this page, we can see the details related to the object. On the left side under the detail section of the expense object page, we can see the Fields and Relationships option is present. Click on the Fields and Relationship option.

5. After clicking on the Fields and Relationships option, the Fields and Relationships page is open. Under this page, we can see that lots of fields are already created. If we want to create a new field, for that we click on the new button.

6. Under this page, we can see lots of data types are present here we select the number field and then click on the next button. After clicking on the data type our expense page is open, under this page we can see the information related to the expenses fill information carefully.

How to set the default value for the number field in Salesforce Lightning

7. First fill the field label as Amount and then fill the field name after that we scroll to the bottom of the page there is a default value field present here we want to set the default value for this Amount field as $200 and then click on the next button.

Set the default value for the number field in Salesforce

8. After filling the complete information, 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.

See also  How to rename the picklist value in Salesforce

9. After establishing the field-level security 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.

Set the default value for the number field in Salesforce Lightning

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 and then click on the save button.

Salesforce set the default value for the number field

11.  Click on the App Launcher, click on the 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. If the object is not shown on the nav bar click on the More drop-down arrow and under this More drop-down list, we can see lots of objects present. Click on the expense object.

13. The expense object page is open and under this object, we can see the records are present that are already present. Here we we are creating a new record so we click on the new button.

14. The new expense page is open and under this page, we can see the information related to expenses. First, fill in the expense name and then fill the transaction date and then fill the item name, and then fill the cost, and that fill the seller details then we can see that the amount field is by default field that is 200 it shows the rate of the expense and then click on the save button.

Salesforce Lightning set the default value for the number field

15. After filling the information related to the expense object, our expense record executive chair is created and our executive chair detail page is open under this page, we can see our default value which is the amount field of the executive chair, and our amount field is set to $200.

How to set default value for the number field in Salesforce

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

How to set the default value for the number field in Salesforce Classic

Here we will learn how to set the default value for the number field in Salesforce Classic. Let us take an example to clear our scenario, suppose there is a company that is famous for selling their products because the company products are very useful for the customers, so the customers want only the company products.

See also  Setting Default Values in Salesforce Picklist Field

So that the company members decided to make every product prize fixed. So for that, it uses the Salesforce. In the salesforce, there is a custom object present called product, and under that, we can see there is a default price custom field we set the default value for this default price custom field and here we are setting the default value for the product is 500.

Here are the following steps:

1. Go to the Salesforce account, our Salesforce Lightning account is open but we wanted to work on the Salesforce Classic version to move to the Salesforce 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. The drop-down list is open, after clicking on the drop-down arrow. Under this drop-down list, we can see that the Setup option is present. Select the Setup option. The Setup page is open. 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.

4. Enter the product in the Quick Find Box and the product option comes at the top, then click on the drop-down arrow of the product, and under the drop-down list there is a field option present click on the field and our custom object product page is open.

5. There is a detail related to the product object. Now scroll to the bottom of the page, we can see there is a section for custom fields and relationships, and under this section, we can see already created fields are present but we want to create a new field for the product and set the default value for the number field in salesforce.

How to set the default value for the number field in Salesforce Classic

6. Our data type page is open and under this page, we can see lots of data types are present here we select the number field and then click on the next button. After clicking on the data type our project information page is open, under this page we can see the information related to the project fill information carefully.

7. First fill the field label as default price and then fill the field name after that we scroll to the bottom of the page there is a default value field present and here we want to set the default value for this default price field as 500 and then click on the next button.

Set the default value for the number field in Salesforce Classic

8. After filling the complete information, 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 default value for the number field

9. After establishing the field-level security 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 Make Text Area 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 and then click on the save button.

How to set default value for the 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 product object from the nav bar, the product object page is open and under this object, we can see the records are present that are already present.

12. Here we we are creating a new record so we click on the new button. The new product page is open and under this page, we can see the information related to the product.

13. First, fill the product name and then fill the type and then fill the product code, and then fill the Product quality percentage, and then fill the price after that fill the serial number and after that, we can see that our default value for the default price field is by default filled and then click on the save button.

14. After filling the information related to the Product object, our salesforce product record is created and our salesforce product detail page is open under this page.

15. We can see our default value which is the default price field, and our default price field is set to 500 and then click on the save button. Here we can edit, delete, clone, and share by simply clicking on these edit, delete, clone, and sharing buttons.

Set default value for the number field in Salesforce

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

Conclusion:

I hope you read the complete article and get the complete idea related to how to set the default value for the number field in Salesforce.  I have also explained all the steps of setting the default value for the number field in Salesforce Lightning and Salesforce Classic.

You may like to read: