> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/projects/use-cases/record-pages/account-360-relationship-timeline.md).

# Build a Salesforce Account 360 Workspace with Avonni LWC

Select a subsidiary in Relationship Graph to see its tasks in Timeline. Requires Avonni LWC Components and related Salesforce Accounts and Tasks.

<figure><img src="https://3857391697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdHOej9Pd5IxJNGEJMZKW%2Fuploads%2FDOojjLD4Nrx9FxoaC1K9%2Faccount-360-cover.jpg?alt=media" alt="Account 360 in Salesforce Lightning with Summit Iberia and Summit Nordics in Relationship Graph. The Activity panel shows the two dated tasks for the selected Summit Nordics account."><figcaption></figcaption></figure>

### Build the project

Choose how you want to build:

✨ **Build with AI** — Give your AI assistant a ready-to-use prompt.

🛠️ **Build it** — Follow the steps yourself.

{% tabs %}
{% tab title="Build with AI" icon="wand-magic-sparkles" %}
{% stepper %}
{% step %}

#### Set up the assistant and sandbox

Follow [Build with AI](https://docs.avonnicomponents.com/build-with-ai). Use a Salesforce sandbox with [Avonni LWC Components installed](https://docs.avonnicomponents.com/lwc-components/getting-started/installation-and-licenses-management) and the `avonni-lwc-components` skill. Give the assistant access to a Salesforce DX project. Use the sample accounts and tasks from the starter in **Build it**.
{% endstep %}

{% step %}

#### Copy the prompt

{% code title="Account 360 build prompt" collapsedlinecount="10" %}

```

Build a Lightning web component for a Salesforce Account page using Avonni Relationship Graph and Timeline. Use the avonni-lwc-components skill and verify the component APIs and the Graph selection event in the Avonni MCP. Inspect my sandbox and confirm that users can read Account Parent, Billing City, Task Related To, Subject and Due Date. Show me the plan and the sandbox alias before writing files.



Query Account children by ParentId, and show the subsidiary name and city in the graph. On selection, pass the selected Account Id into the Timeline query. Query only dated Task records whose WhatId matches that Id. Map Subject to the item label and ActivityDate to its date. Key the Timeline by the selected Account Id so switching subsidiaries removes the previous Timeline while the new query loads. Show a prompt before selection and after clearing it. Do not use a separate Apex controller to query the display data.



Use one parent Account and two subsidiaries, Summit Nordics and Summit Iberia. Seed two dated Tasks under Nordics and one under Iberia. Validate that switching Nordics → Iberia → Nordics shows only the selected subsidiary's tasks. Test Clear selection and report the runtime, role and actual results. Stop before deploying to production.

```

{% endcode %}
{% endstep %}

{% step %}

#### Review and try it in Salesforce

Review the component queries and confirm the test org before deploying to your sandbox. Open the parent Account and run [Try it](#try-it). The Avonni components run the queries and render the graph and timeline. The wrapper LWC keeps track of the selection. Salesforce controls which Accounts and Tasks the user can read.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Build it" icon="screwdriver-wrench" %}
{% stepper %}
{% step %}

#### Set up the sample

Use a Salesforce sandbox with [Avonni LWC Components installed](https://docs.avonnicomponents.com/lwc-components/getting-started/installation-and-licenses-management). Your test user needs access to the package and read access to the sample Accounts and Tasks. Use a sandbox admin to deploy the starter and create the fixture.

[Download the Account 360 Salesforce DX starter](https://3857391697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdHOej9Pd5IxJNGEJMZKW%2Fuploads%2F2CNRFQrm7JiIclCsqyM4%2Faccount-360-lwc-starter.zip?alt=media). Extract it and open that folder in a terminal. Replace `<sandbox-alias>` with your sandbox alias.

{% code collapsedlinecount="10" %}

```sh

sf project deploy start --source-dir force-app --target-org <sandbox-alias> --wait 5

sf apex run --file data/seed.apex --target-org <sandbox-alias>

```

{% endcode %}

The fixture creates **Codex Account 360 - Summit Group**, two child Accounts, and three dated Tasks. The seed script checks for a sandbox and stops if a parent from a previous run already exists.
{% endstep %}

{% step %}

#### Map the graph and the timeline

Open `force-app/main/default/lwc/avonniAccount360Demo`. Use the parent Account ID to filter Relationship Graph with `ParentId = '<parent-account-id>'`. Map Account `Name` to the label, `Id` to the item name, and `BillingCity` to a displayed field.

Listen for the graph’s `select` event and read `event.detail.record.Id`. Create a Timeline query for `Task` with `WhatId = '<selected-account-id>' AND ActivityDate != null`. Map `Id`, `Subject` and `ActivityDate` to the item name, label and start date. Keep the selected account ID as the wrapper key so that Lightning replaces the old Timeline when the selection changes.
{% endstep %}

{% step %}

#### Open the workspace

Add **Avonni Account 360** to an Account record page in Lightning App Builder and open the sample parent Account. For a sandbox test without changing the page assignment, get the parent Account ID with the query below and open `/lightning/cmp/c__avonniAccount360Demo?c__accountId=<parent-account-id>` on your sandbox’s Lightning domain.

{% code collapsedlinecount="10" %}

```sh

sf data query --query "SELECT Id FROM Account WHERE Name = 'Codex Account 360 - Summit Group'" --target-org <sandbox-alias>

```

{% endcode %}
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

### Try it

1. Expand **Accounts (2)**. The Activity panel asks you to select a subsidiary.
2. Select **Summit Nordics**. The Timeline shows **Nordics renewal review** and **Nordics onboarding follow-up**.
3. Select **Summit Iberia**. The Timeline shows only **Iberia launch planning**. Select Nordics again and confirm both Nordics tasks return.
4. Click **Clear selection**. The prompt returns and the Timeline is removed.

**Sandbox result.** All four checks passed in Salesforce Lightning using the starter’s direct component URL and a sandbox admin account.

### Component references

* [Relationship Graph](https://docs.avonnicomponents.com/lwc-components/data-driven-components/relationship-graph)
* [Timeline](https://docs.avonnicomponents.com/lwc-components/data-driven-components/timeline)


---

# 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.avonnicomponents.com/projects/use-cases/record-pages/account-360-relationship-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.
