How to Create Date Time Field Type in Salesforce

In this Salesforce tutorial, we will learn how to create the date time field type in Salesforce we can use it to enter the date and time and we can also pick up the date and time from a pop-up calendar. Moreover, we will focus on some of the practical scenarios for implementation.

Recently, I worked in the Salesforce company that is placed in the USA. While working here, I got a task where I needed to enter the date and time to complete the task on time. The date and time can help us to submit the task on time. To fulfill this requirement, I use the Date/Time field Type, which is present under the Field and Relationship.

So, as a solution, I discovered the Date Time field that permits the users to enter the date or pick a date from a pop-up calendar and select the date and time according to their suitability.

It is a custom field that permits us to choose the date and time from the calendar. Let’s go into more detail about creating the date time field type in Salesforce Lightning and Salesforce Classic.

Date Time field type in Salesforce

The date time field type is defined as one that permits the users to enter the date and time or pick a date or time. When the user clicks a date or time in a pop-up dialogue box. After selecting the date and time, the date and the current time are entered into the date and time field.

For example, there is a company in the USA, that gets the project on Salesforce and also has a last date to complete this project, and the Salesforce team of the company start working on the project and they want to complete this project on time so they choose the date time field type.

After choosing this field type one team member can enter the date and time or pick a date or time from a pop-up calendar. When the user clicks a date or time in a pop-up dialogue box, the date and the current time are entered into the date and time field. Now this date and time can remind all the team members to complete the project and submit the project on time.

Now, let’s move further and see how to create the date time field type in Salesforce Lightning and Salesforce Classic.

Read How to Create Date Field Type in Salesforce

How to create the date time field type in Salesforce Lightning

Here we are creating a date and time field type in Salesforce Lightning. Here we are taking an example we are using the agent work object inside this agent work object we want to add the date and time as a date time field.

Here we take an example there is a company that hires employees who work as an agent and the company gives the targets to all the agents to sell their product on time that time or date they give. If they completed their target on time the company gives a bonus to that agent who works on time.

To set the agent time and date the company uses the date and time field and this date time data type is present under the Field and Relationship.

If you want to learn how to create the date time field type in salesforce lightning, follow these steps:

Step-1: Login into your Salesforce lightning account, Go to the gear icon. Under the gear icon, there are two options present first one is Setup, and another one is Service Setup. Here we are clicking on the Setup option.

After clicking on the setup option, the setup page is open. Click on the Object Manager at the nav bar near the home tab.

How to create the date time field type in Salesforce

Step-2: The Object Manager page opens after clicking on the Object Manager. Here we can see lots of objects are present. Here we want to select the agent work object. To select the agent work object, enter the agent work object in the search box. The agent work object comes at the top, click on the agent work object.

How to create the date time field type in Salesforce Lightning

Step-3: The agent work object page opens after clicking on the agent work object. Under this agent work object page is a details section with field and relationship options. Click on the fields and relationship option.

Create the date time field type in Salesforce

Step-4: The field and relationships page opens after clicking on the field and relationship option. To create the field type, click on the new button at the top of the field and relationship page.

Create the date time field type in Salesforce Lightning

Step-5: After clicking the new button, the data type page opens. There are lots of data types present on the page. Here we select the date time type field at the bottom of the page.

The date time field type is defined as one that permits the users to enter the date and time or pick a date or time. When the user clicks a date or time in a pop-up dialogue box. After selecting the date and time, the date and the current time are entered into the date and time field. Click on the new button.

Salesforce Create the date time field type

Step-6: The agent works new custom field page opens after clicking the next button. Now enter the details, first fill the field label as Submission Date and Time after that fill the field name by simply clicking on the field, and the field name is automatically filled, then fill the description if you want to fill otherwise leave the field the same.

After that, click on the next button presented at the top and the bottom of the page.

Salesforce Lightning create the date time filed type

Step-7:  After entering the details, now established the field-level security. Select the profiles we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.

Click on the visible checkbox and then click on the next button at the top and the bottom of the established field-level security page.

After establishing the field-level security, now add the custom field to the page layout. Select the page layout that should include this field.

This field will be added as the last field in the first 2-column section of this page layout. The field will not appear on any pages if we do not select a layout. Click on the save button.

How to create date time field type in Salesforce

Step-8: After Clicking on the save button, Now again click on the agent work object, the agent work object page is open. Click on the field and relationship. The field and relationship page is open and under this page.

The submission date and time fields are created successfully. And this submission date and time field are created under the field and relationships section.

How to create date time field type in Salesforce Lightning

This way, we understand how to create the date time field type in Salesforce Lightning. Let’s Proceed and learn how to create the date time field type in Salesforce Classic.

Read How to Create Currency Field Type in Salesforce

How to create the date time field type in Salesforce Classic

Here we are creating the date time field type in Salesforce Classic. Here we are taking an example. We are using the account object inside the account object, we want to add the Credit card expiry date time field as a date time field.

If you want to learn how to create the date time field type in Salesforce Classic, follow these steps:

1: First log in to the Salesforce account, when we log in, the Salesforce lightning edition is open. Moving to Salesforce Classic, click on the Profile picture. The Profile picture drop-down list is open. Under this profile picture list, there is an option to switch to Salesforce Classic. Click on it.

After clicking on the switch to Salesforce Classic option, click on the drop-down arrow of the username. The drop-down list is open, under this list Setup option is present below the My Profile option. Click on the Setup.

How to create the date time field type in Salesforce Classic

2: The setup page is open after clicking on the setup option. Enter the lead in the Quick Find Box. The accounts object comes at the top, click on the accounts drop-down menu. The drop-down list is open, under this drop-down list there is a field option. Click on the field option.

Create the date time field type in Salesforce Classic

3: The accounts custom field page is open after clicking on the fields option. Scroll to the bottom of the page, there is an account custom field and a relationship section. For creating the new field click on the new button.

Salesforce classic create the date time field type

4: After clicking the new button, the data type page opens. There are lots of data types present on the page. Here we are selecting the date time data type field at the bottom of the page.

The date time field type is defined as one that permits the users to enter the date and time or pick a date or time. When the user clicks a date or time in a pop-up dialogue box. After selecting the date and time, the date and the current time are entered into the date and time field. Click on the new button.

How to create date time field type in Salesforce Classic

5: The account’s new custom field page opens after clicking the next button. Now enter the details, first fill the field label as Credit Card Expiry date and time after that fill the field name by simply clicking on the field, and the field name is automatically filled, then fill the description if you want to fill otherwise leave the field the same.

After that, click on the next button presented at the top and the bottom of the page.

Create date time field type in Salesforce Classic

6: After entering the details, now established the field-level security. Select the profiles we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.

Click on the visible checkbox and then click on the next button at the top and the bottom of the established field-level security page.

Salesforce Classic create date time field type

7: Add the custom field to the page layout after establishing the field-level securitySelect the page layout that should include this field. This field will be added as the last field in the first 2-column section of this page layout. The field will not appear on any pages if we do not select a layout. Click on the save button.

How to create a date time field type in Salesforce Classic

So, with this, we have learned how to create a date time field type in Salesforce Classic.

Conclusion:

When the user clicks a date or time in a pop-up dialogue box. After selecting the date and time, the date and the current time are entered into the date and time field. The date time field type is defined as one that permits the users to enter the date and time or pick a date or time.

I hope you learn how to create a date time field type in Salesforce. Also, I have explained step by step how to create the date time field type in Salesforce Lightning and in Salesforce Classic.

You may like to read: