> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/product-tour/calendars-and-timelines/object-timeline.md).

# Object Timeline

Show activities and any standard or custom object records together on one timeline.

GridMate provides a component to display records in a timeline. **GM - Object Timeline** is highly configurable to display any kind of object as a timeline.

Salesforce standard Activity Timeline supports Activities ( Emails, Tasks, Events, Lists emails, Logged calls ) in accounts, cases, claims, contacts, contracts, insurance policies, leads, opportunities, and activity-enabled custom objects. **GM - Object Timeline** will cater for activities as standard timeline and any standard/custom object.

In this tutorial, we will setup a custom timeline and configure fields to display tasks/events and the opportunity object on the same timeline. Below is a quick demo on how to configure the **GM - Object Timeline** component in the opportunity record page.

{% embed url="<https://youtu.be/LP3qybeFqDU>" %}
Object Timeline Demo
{% endembed %}

Below is the JSON Config configured for the demo.

```coffeescript
[
    {
        "objectApiName": "Opportunity",
        "refFieldApiName": "Id",
        "titleField": "Name",
        "dateField": "CloseDate",
        "summaryField": "Name",
        "detailFields": [
            "StageName",
            "NextStep"
        ],
        "themeInfo": {
            "iconName": "standard:opportunity",
            "color": "black"
        },
        "recordActions": [
            {
                "name": "View",
                "label": "View",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "view"
                    }
                }
            },
            {
                "name": "Edit",
                "label": "Edit",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "edit"
                    }
                }
            },
            {
                "name": "Opportunity.gmpkg__Update_Stage",
                "label": "Update Stage"
            }
        ]
    },
    {
        "objectApiName": "Task",
        "refFieldApiName": "WhatId",
        "titleField": "Subject",
        "dateField": "ActivityDate",
        "summaryField": "WhatId",
        "detailFields": [
            "Subject",
            "Description",
            "Status"
        ],
        "overdueExp": {
            "Status": {
                "operator": "!=",
                "value": "Completed"
            }
        },
        "filter": "{\"and\":[{\"Type\":{\"operator\":\"in\",\"value\":\"('Meeting','Email')\"}}]}",
        "themeInfo": {
            "iconName": "standard:task",
            "emailBodyHeight": "20rem",
            "color": "black"
        },
        "recordActions": [
            {
                "name": "View",
                "label": "View",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "view"
                    }
                }
            },
            {
                "name": "Edit",
                "label": "Edit",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "edit"
                    }
                }
            }
        ]
    },
    {
        "objectApiName": "Event",
        "refFieldApiName": "WhatId",
        "titleField": "Subject",
        "dateField": "ActivityDate",
        "summaryField": "WhatId",
        "detailFields": [
            "StartDateTime",
            "EndDateTime",
            "Subject",
            "Description",
            "Status"
        ],
        "themeInfo": {
            "iconName": "standard:event"
        },
        "recordActions": [
            {
                "name": "View",
                "label": "View",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "view"
                    }
                }
            },
            {
                "name": "Edit",
                "label": "Edit",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "edit"
                    }
                }
            }
        ]
    }
]
```

The most important property is the Timeline Configuration which a user needs to insert as a JSON string similar to the below block of code.

```coffeescript
[
    {
        "objectApiName": "Task",
        "refFieldApiName": "WhatId",
        "titleField": "Subject",
        "dateField": "ActivityDate",
        "detailFields": [
            "Subject",
            "Description",
            "Status"
        ],
        "overdueExp": {
            "Status": {
                "operator": "!=",
                "value": "Completed"
            }
        },
        "recordActions": [
            {
                "name": "View",
                "label": "View",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "view"
                    }
                }
            },
            {
                "name": "Edit",
                "label": "Edit",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "edit"
                    }
                }
            }
        ],
        "themeInfo": {
            "iconName": "standard:event",
            "color": "black"
        }
    }
]
```

The component can be configured as follows:

* **objectApiName**: Object API name you need to configure.
* **refFieldApiName:** Reference field API name to retrieve related records based on the current record. In this case, using `WhatId` will retrieve all tasks related to the opportunity.
* **titleField:** Field API name to display the title.
* **dateField:** Field API name to display the date.
* **detailFields:** Array of fields to display as a detail view.
* **filter:** JSON string to define filter criteria. Don’t forget \_\_c for custom fields.

  See [GM - RelatedList Grid ](https://docs.gridmate.io/package-reference/components-library/grids/gm-relatedlist-grid.md#specification)filter property for more details.
* **overdueExp:** Logical expression to check if the activity is overdue. The expression is evaluated only if the activity date is in the past. If the activity is overdue, it will be displayed at the top of the timeline.
* **recordActions:** Configure record actions to support editing, viewing, initiating a custom action, or running a flow.
  * **visibility:** Optional rule on a record action. The action is displayed only on entries matching the rule; same syntax as `filter`. See [Action Visibility](#action-visibility).

{% hint style="info" %}
If the Task is an Email , the summary field will display the TextBody in the EmailMessage and the detail section displays the HtmlBody.
{% endhint %}

## Action Visibility

Add a `visibility` rule to a record action to show it only on the timeline entries that match. Actions without a rule are always displayed, and the fields used by a rule are queried automatically. Rules can be combined with `and` / `or`.

In the configuration below, **View** is always available while **Edit** is hidden on completed tasks.

```coffeescript
[
    {
        "objectApiName": "Task",
        "refFieldApiName": "WhatId",
        "titleField": "Subject",
        "dateField": "ActivityDate",
        "detailFields": [
            "Subject",
            "Description"
        ],
        "recordActions": [
            {
                "name": "View",
                "label": "View",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "view"
                    }
                }
            },
            {
                "name": "Edit",
                "label": "Edit",
                "navigate": {
                    "type": "standard__recordPage",
                    "attributes": {
                        "actionName": "edit"
                    }
                },
                "visibility": {
                    "Status": {
                        "operator": "!=",
                        "value": "Completed"
                    }
                }
            }
        ],
        "themeInfo": {
            "iconName": "standard:task",
            "color": "black"
        }
    }
]
```

## Global Actions

Global Actions add a menu to the timeline header, next to **Refresh**. Each action runs a Salesforce quick action or a screen flow in a modal, using the current record as context. When the action completes, a success toast is displayed and the timeline reloads automatically.

In the example below, a sales rep logs a follow-up task on an Opportunity directly from the timeline.

**The flow:** **GM - Timeline Follow-up** is a screen flow that asks for a Subject, a Due Date, a Priority and optional Comments, then creates a Task linked to the Opportunity and assigned to the current user. The flow receives the Opportunity Id through its `recordId` input variable.

**The configuration:** paste the JSON below into the **Global Actions** property of the component, and check **Show Header**.

```coffeescript
[
    {
        "name": "timelineFollowUp",
        "label": "Log Follow-up",
        "component": "gmpkg:DataGridCallFlowComponent",
        "modalSize": "medium",
        "attributes": {
            "flowName": "GM_Timeline_Follow_Up",
            "recordIdParam": "recordId"
        }
    }
]
```

Each action can be configured as follows:

* **name:** Unique key of the action. For a quick action, use the quick action API name.
* **label:** Text displayed in the menu and used as the modal title.
* **component:** Optional. Set to `gmpkg:DataGridCallFlowComponent` to run a screen flow. If omitted, the action runs a Salesforce quick action.
* **modalSize:** Optional. Size of the modal: `small`, `medium` or `large`. Default is `medium`.
* **attributes:** Optional. Parameters passed to the action.
  * **flowName:** API name of the screen flow to run.
  * **recordIdParam:** Name of the flow input variable that receives the current record Id.
  * **inputVariables:** Optional array of extra flow inputs (ex: `[{"name": "source", "type": "String", "value": "Timeline"}]`).

To add more actions, add another entry to the array with its own **name**.

{% hint style="warning" %}
The **Global Actions** menu is displayed only when **Show Header** is checked. If no action is configured, the menu is hidden.
{% endhint %}

Below is a quick demo of the Object Timeline Global Actions, where the user can log a follow-up task from the timeline header and see it appear on the timeline without leaving the record page!

{% embed url="<https://youtu.be/f4rxXzRuL04>" %}
Object Timeline - Global Actions Demo
{% endembed %}

## Next steps

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>GM - Object Timeline</strong></td><td>Every property of the component.</td><td><a href="https://docs.gridmate.io/package-reference/components-library/calendars-and-timelines/gm-object-timeline.md">GM - Object Timeline</a></td></tr><tr><td><strong>Object Timeline config</strong></td><td>Sample timeline configuration showing tasks with detail fields, overdue rules and record actions.</td><td><a href="https://docs.gridmate.io/package-reference/config-samples/object-timeline.md">Object Timeline</a></td></tr><tr><td><strong>Grid - Mass/Record Actions</strong></td><td>Configure quick actions and flows as mass and record actions.</td><td><a href="https://docs.gridmate.io/advanced-guides/grid-actions/actions-library.md">Grid - Mass/Record Actions</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/product-tour/calendars-and-timelines/object-timeline.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
