How to Create Date Field Type in Salesforce

A Date Field in Salesforce can be used to enter the date, and we can also pick up the date from a pop-up calendar.

In this Salesforce tutorial, We will learn to create and configure the Salesforce date field in the Account object.

Date field type in Salesforce

In Salesforce we can create custom fields on any standard Salesforce object or custom object. We can choose from many different data types, such as formula, date, text, numeric, email, phone, picklist, etc.

The date field type is defined as one that permits users to enter a date and store it without any related time information.

The Salesforce data field is available for both editions of Salesforce Lightning and Salesforce Classic.

Create a Date field type in Salesforce

To create a custom Date field in Salesforce, navigate to the setup page of Salesforce Lightning and follow the below steps.

1. On the Setup page of Salesforce, click on the Object Manager tab.

2. In the Object manager setup, select the object in which you have to create the custom Date field. In this example, I have selected the Account object.

3. In the next window, select Fields & Relationships and click on the New button.

Create a Date field in Salesforce

4. From the list of data types, select the Date option and click the Next button.

Salesforce date field type

5. Enter the required details to create a custom date field.

  • Enter the Field Label for the date field and the Field Name for the date field.
  • Enter the optional fields Description and Help Text.
  • Select the Required checkbox to make this date field mandatory to enter.
  • In the Default field, we can enter a date or a formula that will return a date. For example, I have used the Today() function to set the current date as default.
  • At last, click on the Next button,
Salesforce Create a Date Field

6. In the Next step, select the profiles to set the field level security on this date field. The selected profiles will be able to view and edit the custom date field.

Salesforce default date field

7. Select the Page layouts to make this date field visible on the page layouts of the Object records. The field will be visible only on the selected page layouts.

Set default value for date value in Salesforce

As we click Save, the custom date field will be created in the selected object.

See also  Salesforce Add Address Field to Custom Object

8. Navigate to the Account object tab and open any record; there, you will see the Custom date field that we have created.

Create a Date field in Salesforce Lightning

In this way, we can create a Salesforce date field by following the above steps.

Conclusion

In this Salesforce tutorial, we have learned about the process of creating a Custom date field for a Salesforce object. In the above example, we have created the Salesforce date field in the Account object, and the steps should be followed to create a date field in any of the Standard or custom Salesforce objects.

Along with this, we also learned to set a default value for the Salesforce date field.

You may like to read: