Skip to content
Guide

Track an object

Choose an object and its fields so Sojourn records how long each record spends in each value and with each owner.

Salesforce admin About 10 minutes Since 1.0

The setup screens arrive in sprint 3. Until then, you set up tracking from the Tracked Objects tab in the Sojourn app.

Choose the object and fields#

  1. Create a Tracked object. Set Object API Name (for example Case) and select Active.
  2. Add a Tracked field for each field whose time in each value you want: Field API Name (for example Status) and Field Type (Picklist, Lookup, Text, Checkbox, or Date).
  3. To measure time with each owner, add a Tracked field with Field API Name OwnerId and Field Type Owner. From sprint 3, saving a Tracked object with Track Owner selected adds this row for you.

How changes are captured#

  • Case, Lead, and Opportunity are captured by triggers that ship in the package. Once their Tracked object is active, every save that changes a Tracked field closes the open Interval and opens the next.
  • Any other object, standard or custom, is captured from a record-triggered Flow that you own. Add the action Sojourn: Capture Change to an after-save Flow on the object, run it on create and update, and pass {!$Record} as Record and {!$Record__Prior} as Prior record. If an update Flow leaves Prior record empty, Sojourn compares the record with its open Intervals and times the change now. A ready-made Flow template ships in sprint 3.
  • If both a trigger and a Flow capture the same change in one save, Sojourn records it once.
  • Each Interval records how the change arrived in its Source field: Trigger, Flow, or Catch-Up.

Often missed. Setup objects such as User and Group cannot be tracked. Salesforce does not allow their changes and Sojourn's Intervals to be saved in one transaction.

Business hours for each Interval#

Sojourn uses the first of these that is set:

  1. The Tracked field's Business Hours Id.
  2. A business hours field on the record, named in the Tracked object's Business Hours Source Field.
  3. The queue's entry in Queue Business Hours, while a queue owns the record.
  4. The Tracked object's Business Hours Id.
  5. The default in Sojourn Settings.
  6. The org default business hours.

If none applies, or the chosen business hours no longer exist, the Interval gets calendar minutes as business minutes, and a Tracking error of type BusinessHours tells you which setting to fix.

Pause capture during a bulk import#

Select Pause Capture on the Tracked object before a large import or update, and clear it afterwards. Set Paused Since to the time the pause started; the setup screen's toggle in sprint 3 fills it for you. While paused, triggers and Flows skip the object, so the import runs without Sojourn's work. The catch-up job that replays the records changed during the pause arrives in sprint 4.

Tracking errors#

Sojourn never fails your users' saves. If it cannot record a change, it writes a Tracking error instead, visible to Sojourn admins on the Tracking Errors tab. Error Type tells you what happened:

  • DML: the Interval could not be saved.
  • Limit: the transaction was too close to a governor limit, so Sojourn stepped aside.
  • Config: a Tracked field names a field that does not exist.
  • BusinessHours: no usable business hours applied, so calendar minutes were recorded.
  • Unknown: anything else; the stack trace is kept for support.

Each row keeps the record, field, and values, so the repair action in sprint 4 can replay it. To stop all capture at once, clear Tracking Enabled in Sojourn Settings (Setup, Custom Settings).

You are done when you change a Tracked field on a record and a new open Interval appears for it, with the previous one closed.

Updated in 1.0 This page changes in the same pull request as the feature it describes.