Tracking Time to Salesforce Tasks and Activities


Salesforce does not support direct time tracking to Tasks and Activities. However, this can be achieved by activating the Auto Tracking Lightning Component and by adding a Trigger as described below.


Auto Tracker on the Account Page


Step 1: Enable Auto Tracking. Click here to learn more about adding the Auto tracking component to an object in your org. 


  • Auto Tracker can be added to any object in Salesforce. For demonstration, we’ll use Accounts as the example object.

Step 2: Account View Page Integration


  • Once the Auto Tracking component is added to the Account view page, it starts tracking time automatically whenever a user views the page. This creates a TT Detail record with the account reference and the tracking start time.


Step 3: Tracking Time to Task/Event


If the user then:

  • Creates a new Task or Event, or

  • Opens an existing Task/Event from the Activity section or Related tab,

The component switches to tracking time specifically for that Task or Event. In this case:

  • A new TT Detail is not created. And the fields "related Task Start Time" and "Related Task End Time" fields gets updated in the existing TT Detail

Example Scenarios:
  • Creating a Task, like writing or sending an email to a customer.

  • Scheduling an event, such as a call or meeting.

Trigger Requirement


Create an After Update trigger on the TT Detail object to:

  • Update the time worked in the related Task/Event's

  • Use values from the existing TT Detail record.