TimelineObjectDefinition defines a timeline that presents a Salesforce record's related events in a linear, time-sorted view. It controls the view, not the underlying event records. Its required baseObject identifies the standard or custom Salesforce object whose related information the timeline displays.
Most configuration is stored as JSON inside the required definition string. That JSON identifies the related record sources, relationship fields, filters, displayed information, and dates used to place records on the timeline. The org's Timeline preference controls availability of this metadata type; isActive separately controls whether an individual timeline configuration is active.
Key Elements
The first five entries below are metadata fields, including the inherited identity field. The remaining entries are keys inside the JSON stored in definition, not separate XML elements.
| Element | What the Element Controls |
|---|---|
fullName |
The component's metadata identity, inherited from Metadata. It is distinct from the user interface label. |
baseObject |
Required. The standard or custom Salesforce object on which the timeline is based. Related objects supply the information displayed in the timeline. |
definition |
Required. A string containing the timeline definition in JSON format. |
isActive |
Whether this timeline configuration is active: true or false. This does not replace the org-level Timeline preference. |
masterLabel |
Required. The user interface label of the timeline object definition record, not its metadata identity. |
oneToMany |
Groups an event source with its relationship to the base record, filters, and sort field. |
eventObject |
Identifies a related source object. Its configuration includes name, fieldsToDisplay, relatedlistsToDisplay, title, and subTitle. |
anchorReferenceField |
Identifies the field that relates source records to the anchor record, meaning the base record whose timeline is being viewed. |
filters |
Specifies record-selection criteria for a source. The Salesforce example filters Case records using Status, operator EQ, and value New. |
sort |
Identifies the date field used for an event source. Different sources can use different date fields. |
Behavior and Constraints
The org must have the Timeline org preference enabled for TimelineObjectDefinition to be available. Configuration-level activation is separate: isActive indicates whether a particular timeline is active. Setting it to true is not a substitute for enabling the org preference.
The source object, relationship field, filters, and sort field work together. For example, an Account-based timeline can include:
- Case records related through
AccountId, filtered toStatus = New, and placed on the timeline usingCreatedDate. - Event records related through
WhatIdand placed usingActivityDate. - Task records related through
WhatIdand placed usingActivityDate.
These are configuration examples, not required sources or defaults. A single timeline can use different filters and date fields for each source.
For unexpected timeline contents, inspect the source object, anchorReferenceField, and filters inside definition. For unexpected dates, inspect the source's sort field. Neither baseObject nor isActive alone explains which related records appear or where they fall on the timeline.
Deployment and Retrieval
Components use the .timelineObjectDefinition suffix and are stored in the timelineObjectDefinitions folder. The component's metadata identity is fullName; the required masterLabel is its display label.
The type supports the * wildcard in package.xml. To select all components of this type, use TimelineObjectDefinition as the type name and * as the member value. See Salesforce's file-based deployment and retrieval documentation.
When reviewing a retrieved component or preparing a deployment, inspect the JSON string as well as the outer metadata fields. baseObject exposes only the base-object dependency. Source object names, relationship fields, displayed fields, filter fields and values, and sort fields are embedded in definition. Deployment impact depends on those actual names and values and the corresponding configuration in the destination org.
Relationships
The explicit outgoing metadata reference identifies the base object. Additional object and field dependencies are embedded in the JSON and must be inspected there. Translations have a separate incoming relationship to the timeline definition.
References
-
CustomObject:baseObject, including metadata definitions representing standard Salesforce objects.
Referenced By
-
Translations:name.
Common Questions
Why is TimelineObjectDefinition unavailable in my org?
The org must have the Timeline org preference enabled. This availability requirement is separate from the isActive setting on an individual timeline configuration.
Does deploying TimelineObjectDefinition deploy the related event records?
No. The type defines the timeline view, not its underlying records. Its JSON configuration identifies which related records the view displays.
Why does my timeline show the wrong records or dates?
Inspect definition. The source object, anchorReferenceField, and filters determine the related records selected, while the source's sort field identifies the date used on the timeline.
How do I retrieve all TimelineObjectDefinition components?
Use TimelineObjectDefinition as the type name and * as the member value in package.xml. Components use the .timelineObjectDefinition suffix in the timelineObjectDefinitions folder.
Is baseObject enough to identify the deployment dependencies?
No. It identifies the base-object reference, but additional object and field dependencies are embedded in definition. Inspect that JSON for the configured sources, relationship fields, display fields, filters, and sort fields.