Skip to content
Release 1 in development, 16 of 16 sprints done. Early access is open. 16 of 16 sprints done · Join early accessJoin early access
Guide

Track an object

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

Salesforce admin About 10 minutes Since release 1

You set up tracking in the Sojourn Settings tab of the Sojourn app. The page has a Sojourn menu on the left, in four sections: Capture (Get started, Overview, Tracked objects), Time (Business hours, Goals, Alerts), Data (Retention and purge, Summaries, Export settings), and Operations (Jobs, Health, Advanced). The menu stays in view while a screen scrolls. Choose Collapse menu at its foot to fold it into icons; Sojourn remembers the choice in your browser. The tab needs the Sojourn Admin permission set; without it the page says so and shows nothing else. Changing the org-wide settings, on the Overview and on the Alerts, Jobs, Health, Summaries, Retention and purge, and Advanced screens, also needs the Customize Application permission, which system administrators have.

The Overview#

The Overview opens first once the Get started guide is done or turned off; until then Sojourn Settings opens on Get started, and the Overview shows a banner that continues it. Three counts lead it: active Tracked objects, paused ones, and open errors, with a link to the Health Monitor. Capture for the whole org holds Tracking enabled and the Default business hours, saved with Save settings. One line says how the jobs stand, with Open Jobs; see Run the jobs.

Usage estimates what Sojourn adds to your data storage, at 2 KB a row, from the Sojourn records you can see:

  • Intervals written this month: the Intervals created since the first of the month, about how many a day, and from how many Tracked objects. A backfilled Interval counts in the month it was written.
  • Storage used by Sojourn: every Interval, summary row, Error Log row, and purge run, at 2 KB a row, and its share of your org's data storage. When the storage limit cannot be read, the tile says so and shows no percent. The archive is a big object, which does not count against data storage.
  • A year at this rate: the storage of a year of Intervals at this month's daily rate. With Keep N days on the Plus plan, it is the Intervals kept at any one time, N days of them and at most a year; with Keep everything, a whole year's.

Usage loads after the rest of the Overview, so a slow count never holds the page up, and a failed one says so on its card only.

Add an object#

Case, Lead, and Opportunity are tracked on every plan; for the quickest start, see Track Cases and open your first report. Every other object, custom or standard, is on the Plus plan and needs a capture Flow; see Free and Plus plans.

  1. Open the Sojourn app and the Sojourn Settings tab, then Tracked objects in the menu.
  2. Choose Add object, search for the object, pick it, and choose Add object again. The list shows only objects Sojourn can track, so you never type an API name; objects you already track are marked Already tracked.
  3. On the object's screen, open the Fields tab and check the Tracked fields whose time in each value you want; they appear in the table beside the checkboxes, where Remove takes one off and Business hours sets hours for that field alone (leave it on Use the object's to use the object's hours). Picklists, lookups, checkboxes, dates, and short text fields are offered; formulas, auto-numbers, and long text are not. Each field shows its API name under its label, here and in the snapshot fields, and the field lists read "Label (API name)", so two fields with the same label are never confused; search finds a field by either.
  4. Leave Track owner on to measure time with each user and each queue.
  5. Choose Save.

Track only fields that everyone who reads Intervals may see. Sojourn copies a Tracked field's values into each Interval whatever the field-level security of the person who saved the record, and Sojourn User and Sojourn Site User can read those values, so a field you hide from a group shows to that group through Intervals and the timeline.

A Tracked lookup field records the name of the record it points to, not its Id, and Sojourn reads that name whoever saved the change, so the name shows even to people who cannot open that record, for example a record of a private custom object. The owner's name is copied the same way. Track a lookup only when everyone who reads Intervals may see the names of the records it points to.

The same goes for the other record values each Interval carries. Sojourn User can read the record's name (from the Name field below), the owner's name, the record type, and on Case, Lead, and Opportunity the values Sojourn copies there (Case Priority, Origin, and Type; Lead Source and Rating; Opportunity Stage), and the Interval list views show the record and owner names. Intervals are readable by everyone with Sojourn User, whether or not they can open the record, so choose a Name field such as the record number, not one that holds private text such as a Case subject. Snapshot fields and the Opportunity amount are not readable with Sojourn User. The Name field and Snapshot fields lists offer only fields you can read.

An object can have up to 10 Tracked fields, the owner included. From the sixth, the picker reminds you that each field adds Interval rows for every record; at 10, it asks you to turn one off first. Short text fields are listed apart, under "Usually not useful for time in value".

Each Tracked field has Start timing at the first value, on by default. When a record is created with the field blank, timing starts when the field first gets a value, so reports do not count the blank stretch before anyone filled it in. Turn it off to time the blank value from creation as well. The owner always starts at creation. Once a field has had a value, clearing it is a change like any other: the stay in the old value closes and a blank Interval opens, so time spent blank after a value is measured whichever way the switch is set.

Under the picker, the Estimate shows about how many Interval rows a month your choice adds, and how much of your data storage a year that is. It counts the records you can see that were created in the last 30 days and their field history; fields without history are assumed to change once a month. "At least" means the count reached its limit, so the real number is higher.

Encrypted fields#

Sojourn copies a Tracked field's values onto its Intervals, and the Name field and Snapshot fields too, and no Interval field is encrypted. A field you encrypt with Shield Platform Encryption is therefore stored in plain text on its Intervals. For an encrypted Tracked field, choose Only that the value changed under What an Interval keeps on the Values tab (see The Values tab): its Intervals then keep no From or To value, and the time in each stay is still measured. That choice is not offered on the field that decides when a record closes, so keep an encrypted field out of that role, and choose a Name field and Snapshot fields that are not encrypted. In the Tracked fields picker, a field you encrypt carries an Encrypted pill, in the list and once chosen, with a line under it: "Intervals copy its values in plain text. To keep them off, choose Only that the value changed on the Values tab." On the status field, and on the checkbox Closed when reads, the line says only that Intervals copy its values in plain text, because that choice is not offered there. The picker marks only Tracked fields; check the Name field and Snapshot fields in Setup.

The object's tabs#

An object's screen keeps its header at the top: the object, its capture pill, Active, and Pause. Below it, six tabs hold its settings. Choose a tab, or move along the tab row with the arrow keys, Home, and End.

  • Fields: the Tracked fields, Track owner, and the Estimate.
  • Values: for each Tracked field, the values that do not count, value groups, colours on the timeline, and what an Interval keeps; and which owners get an Interval (see The Values tab).
  • Records:
    • Status field and Closed values: the main status field and the values that mean the record is closed (see When a record closes).
    • Name field: the field shown as the record's name on each Interval.
    • Record types: track only these record types; leave empty for all.
    • Business hours, or Business hours from a record field: the hours used for this object's business minutes.
    • Snapshot fields: up to 5 fields copied onto each Interval, for grouping reports by values such as priority.
    • Records to track: conditions a record must meet to get Intervals; leave empty to track every record (see The Records tab).
    • Business hours by record type: the business hours for each record type of the object (see The Records tab).
  • Backfill: give existing records their Intervals, with the last backfill and the last Catch up; see Backfill past Intervals.
  • Live values: Write live values to the record and its two minute fields, number fields on the record for the minutes in the current status and with the current owner. The Live values job keeps them current on the schedule set on the Jobs screen (see Live values and the jobs).
  • Advanced: the Retention card, how long this object's Intervals are kept, and the Capture card, with the lookup Sojourn fills on each Interval and the History backfill's records per chunk (see The Advanced tab).

Save, at the foot of every tab, saves the changes on every tab together: change the fields on one tab and the settings on another, then save once. Switching tabs keeps what you changed. If a value cannot be saved, nothing is saved, and the notice names the tab that holds it, for example "Check the Records tab. Choose at most 5 snapshot fields." The address names the open tab, so you can copy a link to it; see Links into Sojourn.

The Values tab#

Choose a field in Tracked field, with the status field first; each field keeps its own settings, and they are saved with Save like every other tab. A picklist offers its values, a checkbox offers Checked and Not checked, and for a text field you type a value and press Enter.

  • Do not count these values: a change into one of these values closes the open Interval at the change and opens none, so the clock stops; the next change to a counted value opens an Interval whose From is the value the record left when the change carries it (a save, a Flow that passes the prior record, or repair) or when the field has only one value that does not count; otherwise, as after a Catch up, Reconcile, or Seed backfill, From is blank. Use it for a value such as Waiting on Customer. Blank always counts, and on the status field a closed value always counts, so neither is offered. A goal on a value that does not count never applies, and the Goals screen leaves those values out.
  • Value groups: name a group, up to 80 characters, and add its values; a value can be in one group. Add a group adds a row and Remove takes one away. Each new Interval carries its value's group in Value Group, so reports and summaries can count Backlog as one. A change to the groups applies to Intervals opened after it.
  • Colours on the timeline: Tide, Harbor, Slate, or Mist for each value, or Automatic for the timeline's own order. Coral stays for a Breach and Lantern for the current Interval, so neither is offered. The timeline draws each value's stays in its colour (see Show the timeline on a record).
  • What an Interval keeps: Each value, from and to, the default, or Only that the value changed, for a field whose values are private. With only the change, new Intervals of the field keep From, To, and the group blank, the timeline shows "(hidden)", and an Error Log row for a change it could not record keeps no From or To value either; minutes, the owner, and the sequence are kept, and repair still places such a change by its time. It is not offered on the field that decides when a record is closed, the status field or the checkbox Closed when reads, because the close figures and Record Closed read their values, nor on a field with active goals, which need the values; the tab says which. Intervals already written keep what they hold. A field that keeps only the change is recorded by a save and by a Flow that passes the prior record; Catch up, Reconcile, Seed backfill, and a Flow without the prior record cannot tell that its value changed, so they leave its open Interval as it is.

The Owner card shows while the object tracks its owner. Track sets which owners get an Interval: Users and queues, the default, Users only, or Queues only. Ignore a move between members of the same queue keeps one owner stay when the record moves from one direct member of a queue that takes this object to another; leave it off when reports count time per person.

  • Users only: no owner Interval opens while a queue owns the record. A move to a queue closes the user's stay at the move, and the next user's stay continues the sequence, with From set to the queue the record left. When a Case or Lead assignment rule sends a new record to a queue in the save that creates it, the creator's stay closes at its own start, a stay of 0 minutes; nothing is deleted.
  • Queues only: the reverse. No owner Interval opens while a user owns the record, and a move to a user closes the queue's stay.
  • Ignore a move between members of the same queue: the stay keeps the owner it started with while the record moves between users who are both direct members of one queue that takes this object; a move to anyone else closes it. Users who belong through a role or a nested public group are not direct members. Sojourn reads the queue's members once per save, and which objects each queue takes in system mode, so a user without View Setup and Configuration gets the same result.

Capture, Flow capture, Catch up, Reconcile, and History backfill all follow these choices. A change applies from the next owner change on each record; Intervals already written stay as they are.

If a value cannot be saved, nothing is saved and the notice says so, for example "Check the Values tab. Escalated is a closed value, so it always counts."

The Records tab#

Below Object settings, two more cards:

  • Records to track: only records that match every condition get Intervals. Add a condition adds a row; choose the Field, equal to or not equal to, and the Value, and Remove takes a row away. The fields are the object's picklist, checkbox, and short text fields you can read. A picklist offers its values, a checkbox offers Checked and Not checked with equal to only, and for a text field you type the value; an empty box matches a blank field. Leave the card empty to track every record. Sojourn checks the conditions on the record's values after each save, as it checks Record types: a record that stops matching keeps its open Intervals, and new changes are not recorded until it matches again; then its next change is recorded, and Reconcile repairs what changed meanwhile. A History backfill applies the conditions too.
  • Business hours by record type: one row for each record type of the object, set to business hours or left on Use the next rule. A record of that type uses those hours ahead of the queue's and the object's; the Tracked field's own hours and the record's business hours field still win (see Business hours for each Interval). An object with no record types shows no rows: its records use the Business hours under Object settings.

If a condition or a record type's hours cannot be saved, nothing is saved and the notice names the tab, for example "Check the Records tab. Description on Case cannot be a condition. Choose a picklist, checkbox, or short text field."

The Advanced tab#

  • Retention: how long a purge keeps this object's closed Intervals. Use the org's, the default, follows Retention and purge and names its window, for example "Use the org's: Keep 365 days". Keep this object's Intervals for a number of days, from 30 to 3,650, gives the object its own window; typing in the box chooses it, and the box shows 365 while no number is saved. Keep everything for this object keeps all of them. The object's own days apply only while the org keeps N days: with the org on Keep everything, nothing is deleted. It is on the Plus plan, with purge: on the Free plan it shows with its controls off and the Plus notice, and the rest of the object still saves. See Retention per object.
  • Lookup to fill on each Interval shows only when two or more lookups on Interval point to this object, for example a lookup to Case that you added to Interval beside Sojourn's own. Sojourn fills one of them with the record on every new Interval. Automatic, the default, fills the lookup named after the object, or else the first; choose another to fill that one instead. Only lookups on Interval that point to this object are offered.
  • History backfill: records per chunk: how many records a History backfill reads at a time, from 5 to 50, 20 unless you change it. Each chunk reads every field change of its records, so choose fewer when records have long field history. The box shows the saved number, or 20 while none is saved; clear it to go back to 20. It is on the Plus plan, with History backfill: on the Free plan it shows with its box off and the Plus notice, and the rest of the object still saves. See Backfill past Intervals.

When a record closes#

A record counts as closed while its status field holds one of the Closed values. When the Tracked object's Closed Checkbox Field names a checkbox on the object, such as IsClosed on Opportunity, the record counts as closed while that checkbox is checked instead, and the closed values no longer decide. The list offers every checkbox on the object except Deleted (IsDeleted), which a live record never has checked. A name that is not a checkbox on the object, or IsDeleted, is ignored, with a Config row in the Error Log, and the closed values decide.

While a record is closed:

  • every Interval open on it carries Record Closed, and so does every Interval that opens while it stays closed. An Interval that ends while the record is closed keeps the flag, and so does the one the reopen ends, such as the closed status;
  • the owner's stay ends at the close, with its minutes as usual, and no Owner Interval opens, even when the owner changes;
  • when the record reopens, a new Owner Interval opens for the owner it has then. Intervals still open after the reopen lose Record Closed, because the record is live again, and Intervals that open from then on do not carry it.

History and Seed backfill, Catch up, and the nightly Reconcile follow the same rule; History reads the deciding field's history, and without it a closed record counts as closed since its last change (see Backfill). Reconcile also puts Record Closed in step on the open Intervals of the records it checks and ends their open owner stays, at the entry of the Interval that holds the closed value when there is one, otherwise at the record's last modification.

Check that capture is live#

Each Tracked object shows a pill:

Pill Meaning
Tracked by package Case, Lead, and Opportunity: Sojourn's own triggers capture every change.
Flow active An active Sojourn capture Flow runs on this object.
Flow missing No capture Flow runs yet. Follow the steps on the object's screen.
Flow unknown Sojourn could not read your Flows, usually because you lack View Setup and Configuration.
Paused Capture is paused for a bulk import.
Inactive The object is configured but not tracked.

While an object's pill reads Flow missing or Flow unknown, its screen leads with four steps, and its fields and settings show as summaries until you choose Edit fields or Edit settings. On the Tracked objects list, Set up Flow opens those steps and Re-check Flows checks every object at once:

  1. In Setup, open Flows and the Sojourn Capture Template, then choose Save As, a new Flow. Keep "Sojourn" in the label.
  2. On the Start element, choose your object.
  3. In Sojourn: Capture Change, set the object for Record and Prior record to the same object. Pass the prior record on every save, as the template does: when some saves in one batch pass it and others do not, Sojourn records each correctly but in two passes, at twice the queries. (Sprint 13: Flow Builder shows the action's two inputs in one section, Record change, with Record first and Prior record under it, in place of its alphabetical list.)
  4. Activate the Flow, then choose Re-check on the object's screen. The pill turns to Flow active.

Keep your copy a record-triggered Flow that runs after the save, as the template is: it runs in system context, so it records every user's changes. If you call Sojourn: Capture Change from a screen Flow or another Flow that runs as the user, give those users access to the action's Apex class (ChangeCapture) through a permission set of your own; only Sojourn Admin includes it, and without it the Flow fails for everyone else. Grant it with care: the action records the field values and change time of the record the Flow hands it, without reading the record again, so a Flow that changes that record variable before the action, run by a user with the class, records Intervals for values the record never held.

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, so Sojourn leaves them out of the list.

Pause capture during a bulk import#

The Tracked objects list shows each object's Tracked fields, whether it tracks the owner, its capture pill, and where its business hours come from: named hours, From record field, or Sojourn default.

Choose Pause on the Tracked object, in the list or on its screen, before a large import or update, and Resume afterwards. The list shows when the pause started. To stop tracking an object, turn off Active on its screen and choose Save; Turn on in the list brings it back. A notice at the top of the page says each took effect, for example "Case is paused. Changes made now wait for Catch up." While paused, triggers and Flows skip the object, so the import runs without Sojourn's work. After you resume, the list says "Changes made while paused wait for Catch up". Choose Catch up to replay the records changed during the pause: each gets its Interval at the time it changed (its last modification, or its creation if it was created during the pause), and values Sojourn already holds are skipped, so running it twice is safe. A field with no open Interval gets its first one only on a record created during the pause; on older records it waits for the field's next change, and a blank field timed from its first value gets nothing until it has one. One catch up runs at a time across all objects: while one is going, the list says "Catch up is running" in place of the button, and starting another is refused. If part of the run is skipped or fails (for example, tracking was turned off, or the Error Log records a Limit or DML error), the list keeps offering Catch up, so you can run it again. If you pause the object while a catch up runs, even briefly and resumed before it ends, the pause window is kept for the next catch up. Pausing again before you catch up keeps the earlier start, so one catch up covers both pauses. The result of the last catch up is kept in the Tracked object record's Catch Up Message field, apart from the last backfill result, so a catch up never hides how the backfill went; the object's screen lists both in its Backfill card, as Last backfill and Last Catch up.

Importing past records. When an import sets each record's Created Date (Salesforce's Set Audit Fields upon Record Creation), Cases, Leads, and Opportunities start their first Intervals at that date. A Flow cannot tell a new record from an update, so for other objects also set Last Modified Date to the Created Date in the import; otherwise their first Intervals start at the import.

Backfill past Intervals#

A new object starts with the next change. To give existing records their Intervals, use the Backfill tab of the object's screen; see Backfill past Intervals.

Live values and the jobs#

The Jobs screen, under Operations, schedules Live values, Reconcile, and Summaries, and runs each now. See Run the jobs for when each runs and what it does.

Business hours for each Interval#

Sojourn uses the first of these that is set:

  1. The Tracked field's business hours.
  2. A business hours field on the record, chosen in Business hours from a record field.
  3. The record type's business hours, set in Business hours by record type on the Records tab.
  4. The queue's entry in Queue Business Hours, while a queue owns the record.
  5. The Tracked object's business hours.
  6. The default on the Sojourn Settings overview.
  7. 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 an Error Log row of type BusinessHours tells you which setting to fix. A save, or an Omni-Channel agent work change, writes the row for the business hours it could not use. Live values, Reconcile, and backfill write it too, once while a row with the same words is open, so a job that meets the same business hours on every run adds no second row until you resolve the first. The record timeline and Sojourn Dashboards count calendar minutes the same way and write no row.

When records are merged#

When you merge records, for example two Leads or two Cases, Salesforce keeps one record and deletes the others. The Intervals of a deleted record stay with it: they keep its record Id in Parent Id, and Sojourn does not move them onto the record that remains. The nightly Reconcile closes each Interval still open on the deleted record at the time it was deleted, and checks Orphaned on all of its Intervals (see Run the jobs). Salesforce itself moves the Interval's lookup to the record (for example Lead or Case) onto the record that remains, so report types that start from that record list the merged stays under it. The timeline reads Parent Id, so the remaining record's timeline shows only its own stays, and time with each owner before the merge stays on the record where it was spent. For reports, see Merged and deleted records in the cookbook.

The Error Log#

Sojourn never fails your users' saves. If it cannot record a change, it writes an Error Log row instead; the overview shows how many are open and opens the Health Monitor, which explains each error and fixes it. See Watch Sojourn in the Health Monitor. To stop all capture at once, turn off Tracking enabled on the overview and choose Save settings.

You are done when the object's pill reads Tracked by package or Flow active, and changing a Tracked field on a record opens a new Interval for it and closes the previous one.

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