How to Create Date Time Field Type in Salesforce

In Salesforce, the date and time are entered using the date and field type, and we can also pick up the date and time from a pop-up calendar.

Recently, I worked in a Salesforce company. I received a task where I needed to enter the date and time to complete it on time. The date and time can help us submit the task on time. To fulfill this requirement, I used the Date/Time field Type, which is present under the Field and Relationship.

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 permits users to enter or pick a date and time. 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.

Consider a scenario where a company in the USA gets the project on Salesforce and also has a last date to complete it. The company’s Salesforce team started working on the project, and they wanted to complete it on time, so they chose the date-time field type.

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 take an example: There is a company that hires employees who work as agents. The company gives targets to all the agents to sell their product at the given time or date.

See also  How to Make Currency Field Required in Salesforce

If they complete their targets on time, the company gives a bonus to that agent who works on time. The company uses the date and time field to set the agent’s time and date.

Here are the following steps:

1. Log into your Salesforce account, then Click on the gear icon. Select the Setup option and then Click on the Object Manager tab.

How to create the date time field type in Salesforce

2. Here, we enter the agent work object in the search box and select the agent work object, which is the standard object.

How to create the date time field type in Salesforce Lightning

3. Now select the Fields and Relationships option that is present under the details section.

Create the date time field type in Salesforce

4. Here, we want to create a new field, so we click on the new button.

Create the date time field type in Salesforce Lightning

5. Here, we select the Date/Time checkbox. 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. Click on the new button.

Salesforce Create the date time field type

6. Now enter the details: first, fill in the Field Label as Submission Date and Time. Then, fill in the field name and click on the next button.

Salesforce Lightning create the date time filed type

7. Now establish the field-level security. 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 profiles if we do not add field-level security. Click on the next button.

Now, add the custom field to the page layoutSelect the page layout that should include this field. Click on the save button.

How to create date time field type in Salesforce

8. Now, again, click on the agent work object; the agent work object page is open. Click on the field and relationship. 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.

See also  How to add Picklist Values in Salesforce

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.

Consider a scenario. Here, 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.

Here are the following steps:

1. Login into the Salesforce Account –> Click on the Profile Picture –> Select Switch to Classic Version option –> Click on the Setup option.

How to create the date time field type in Salesforce Classic

2. Enter the accounts in the Quick Find Box. 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 Fields option.

Create the date time field type in Salesforce Classic

3. The accounts custom field page opens. Scroll to the bottom of the page, where there is an account custom field and a relationship section. To create a new field, click on the new button.

Salesforce classic create the date time field type

4. Here, we are selecting the Date/Time data type checkbox. Click on the next button.

How to create date time field type in Salesforce Classic

5. Now enter the details: first, fill in the Field Label as Credit Card Expiry date and time. After that, fill in the field name, and the Field Name is automatically filled. Click on the next button.

Create date time 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 date time field type

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

See also  How to Add Validation Rule for Phone Field in Salesforce

Conclusion:

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: