Monday, October 15, 2018

Create a Custom Field that will Convert Time to Military Time or 24 Hour Clock Format

User Preferences is hh:mm AM/PM (Home > Set Preferences > Time Format = hh:mm AM/PM)

Below are the steps on how to create a custom field that will convert the time am/pm to military time or 24hr clock format.

A.  Create the Time field.
1. Navigate to Customization > Lists, Records, & FieldsEntity Fields > New.
2. Enter a Label (e.g. Time)
3. Set Type as
Time of Day.
4. Check the Store Value field.
5. In the Applies To tab > select the record this field should be applied. For example: select Customer.
6. Click Save.

B.  Create the second field that will convert the time am/pm to military time or 24hr clock format.
1. Navigate to Customization > Lists, Records, & FieldsEntity Fields > New.
2. Enter a Label (e.g. Military time)
3. Set Type as
Free-Form text.
4. Uncheck the Store Value field.
5. In the Applies To tab > select the record this field should be applied. For example: select Customer.
6. In the Validation & Defaulting tab > Default Value = to_char({field ID in step A},'hh24:mi') and check the Formula field.
7. Click Save.

C.  Pull up a sample customer record
1. Fill out Field 1 (Time) = eg.
1:00 pm
2. Click Save.
3. The Field 2 (Military time) = eg. 13:00

Note: The value populates upon saving the record.

 

No comments:

Post a Comment