Track Time on Tasks (Activities) in the Stopwatch

Contents

Overview

This article outlines how to track time on Task records (Activities) using the Stopwatch.

Because you can’t create Task Lookup fields, you can’t create a Task Lookup field on the Time Tracking Summary object, which means you can’t directly link to a Task in the Stopwatch. To get around this limitation, the Task Link object is used to connect the Time Tracking Summary record to a Task. By configuring the Stopwatch’s properties in a specific way, you can track time against Task records.

Task Links

The Task Link object is used to link a Time Tracking Summary to a Task record. Due to the inability to create a lookup field to the Task object, there is not a direct relationship between the three objects, but rather, when the components properties are configured in a specific way, the component will create a Task Link record and set it as the value for the Task Link field on the Time Tracking Summary object. At the same time, the Task Link that is related to the Time Tracking Summary will also be set as the value for the Task Link field on the Task object. With the same Task Link set on both the Time Tracking Summary and Task records, the Task and Time Tracking Summary are connected.

Configure Stopwatch Properties for use with Task Links

In order to configure the Stopwatch to track time on Task records using Task Links, the properties of the component need to be configured in a specific way. In the case where you want to track time on the Task object, set the Second Lookup Field and Second Lookup Default Value properties to TTracking__Task_Link__c (TTracking__Task_Link_Object__c).

When the properties are configured as outlined above, the Stopwatch will determine if there is a value in the Task Link field on the Time Tracking Summary when the component is loaded. If there is not a value in the field, the second lookup field will instead be replaced with text. On click of the Start button, the Stopwatch will insert a Task Link record and update the Task Link field on both the Time Tracking Summary and Task records. If the Task Link field is already populated on the Time Tracking Summary, then the Task Link lookup field will display as normal with the Task Link defaulted in.

Time Tracking Card Before Task Link
Time Tracking Card After Task Link

Configure Stopwatch Properties for use with WhatId & WhoId

An additional function of the Stopwatch properties when used on the Task object is the ability to default the Second Lookup Field value based on the WhatId and WhoId fields on the Task. These fields are polymorphic, meaning they can be set to one of many different object types. When chosen in the component properties, the values in the WhatId or WhoId can be defaulted into the Second Lookup Field value, if compatible. The component will get the chosen value from the selected field on the Task object. If the object type of the value is the same as the chosen second lookup field, the value will be defaulted.

For example, let’s say you choose TTracking__Test_Opportunity_Look_up__c (Opportunity) as the Second Lookup Field and WhatId as the Second Lookup Default Value. If the WhatId value on the Task is an Opportunity, then it will default into the Opportunity lookup field on the component. Otherwise, it will not default into the field.

 

Time Tracking is built by Fostering and powered by Salesforce.