How the Stopwatch Works

Contents

Overview

You can track time on work related to an account and any other object of your choosing using the Time Tracking List component. From the component, select an account record from the Account lookup, then select the desired record in the second lookup. Once both fields have been populated, click the Start button to begin tracking time.

Upon clicking the Start button, a Time Tracking Summary record is created with the account and secondary lookup fields populated. A Time Tracking record is also created under the Time Tracking Summary, with the Start Time set to the current datetime and End Time left blank. Active Time Tracking Summary records will be shown under the main card in separate cards, with the option to close a given summary. The fields displayed in the active Time Tracking Summary can be customized. See Edit an Active Time Tracking in the Stopwatch for more information on how to customize the active Time Tracking Summary card fields.

Upon clicking the Stop button, a modal will display prompting the entry of some fields. These fields can be customized, see Require fields on the Stopwatch Close Modal for more information. Once populated, click the Close Time Tracking button on the modal. This will set the End Time on the latest Time Tracking record related to the summary to the current datetime and uncheck the Active checkbox on the Time Tracking Summary.

Where to Add The Stopwatch Component

In addition to being available from the Stopwatch tab in the Time Tracking app, the Time Tracking List component can also be added to Lightning Record Pages and the Utility bar. See the below sections for information on how to add it, along with the customization options available.

Properties

Some possible property values such as WhatId and WhoId are hard-coded and only relevant in the instance where you want to track time on Task records. See Track Time on Tasks (Activities) for more information on how those property values can be utilized.

Before we add the component to either Lightning Record Pages or the Utility bar, let’s review the properties available for customizing the component. At a high-level, the properties allow you to determine which object lookup should be displayed as the second lookup option on the component besides the account, and what values should default into those lookups. We’ll go over that in a different section. For now, See the below table for the properties and their possible values.

Property

Values

Customization Options

Property

Values

Customization Options

Account Default Value

All lookup fields on the current object which lookup to the Account object.

Based on the value selected, when the component loads, it will determine if the selected lookup field on the object is populated, and if so, that value will default into the Account lookup on the component.

Example: From the Case object Lightning Record Page, you select the AccountId option. When the component loads, the Case record’s Account Id value will default into the Account lookup on the component.

Second Lookup Field

API names of all custom lookup fields on the Time Tracking Summary object, with the name of the object being looked up to in parenthesis next to the field API name.

Based on the value selected, when the component loads, the selected lookup field from the Time Tracking Summary object will display under the Account lookup.

Example: From the Case object Lightning Record Page, you select the TTracking__Test_Case_Look_Up__c (Case) option. When the component loads, the TTracking__Test_Case_Look_Up__c lookup field on the Time Tracking Summary object will display under the Account lookup.

Second Lookup Default Value

API name of all lookup fields on the current object, with the name of the object being looked up to in parenthesis next to the field API name.

Based on the value selected, when the component loads, it will determine if the selected lookup field’s value on the current object is eligible to be set as the value for the specified Second Lookup Field property value noted above, and if so, it will default into the chosen second lookup. Incompatible values for the chosen second lookup field and it’s default cannot be defaulted. For example, The ContactId on the Case object cannot be set as the default for the TTracking__Test_Case_Look_Up__c field on Time Tracking Summary, as a Contact cannot be populated into a Case lookup.

Example: From the Case object Lightning Record Page, you select the Id (Case) option and have TTracking__Test_Case_Look_Up__c (Case) set as the value for the Second Lookup Field property value. When the component loads, the Id of the current Case record will be populated as the default for the Case lookup on the Time Tracking Summary.

Lightning Record Page

To add the Stopwatch component to a Lightning Record Page, navigate to the page and open it in the Lightning App Builder. In the Components panel on the left, find the Time Tracking List component under the Custom accordion section and drag-and-drop it onto the page in your desired location. Once the component is in the desired location, customize it using the properties of the component, referencing the table above to populate the properties.

Utility Bar

To add the Stopwatch component to the Utility bar, navigate the App’s edit page from the App Manager in the Setup menu to which you would like to add the component.

Once in the Lightning App Builder, click the Add Utility Item button. Select the Time Tracking List component under the Custom accordion section and customize the component properties as desired referencing the table in the Properties section above if necessary.

When adding the component to the Utility bar, only the Second Lookup Field property can be customized. The Account lookup cannot be defaulted, nor can the chosen Second Lookup Field value.

 

Time Tracking is built by Fostering and powered by Salesforce.