The Local Time Lightning Component can be placed on any Lightning record pages to show time zone information. Out-of-the-box, this component shows the time zone information for Account, Contact, Lead, Opportunity, and Case Salesforce objects.
- For Account, Contact, and Lead records, the component’s time zone lookup logic is based on the address and phone number fields configured in the Local Time Config tab.
- For Opportunities, the component pulls the time zone information from the related Account record.
- For Cases, the component pulls the time zone information from the related Contact and Account records.
However, (a) if you want to override the above default behavior or (b) if you have another standard or custom object where you would like to show similar time zone information, please read on.
Pre-requisite
It is assumed that you have installed Local Time App version v2.24 or later in your sandbox and production environments. You can install the latest version of the App from this link.
Process
- Create the address and phone custom fields on the object.
- Add the Local Time Lightning Component to the lighting record page layout.
- Configuration the component to use the address and phone custom fields created on the object.
1. Create the address and phone custom fields
Create the Country, State, Postal Code, and Phone custom fields on the object. We recommend that you create them as simple text fields.
Example: Country__c, State__c, Postal_Code__c, Phone__c
2. Add the Local Time Lightning Component
Edit the lightning record page layout and add the component as shown in the below screenshot.
3. Configure the Local Time Lightning Component
Click on the component and input the custom field API names as shown below.
Click the Save button to update the changes, Activate the record page if needed, and return the record page.
Voila! The lightning component now shows the time zone information based on the custom address and phone fields defined on the object.