The native account hierarchy covers accounts only, on its own page. How to show any hierarchy as a tree grid, on a page or in a flow.

Salesforce has a native account hierarchy view, but it covers accounts only and opens on its own page. To show a hierarchy on a record page, inside a Screen Flow, on a custom object, or across several objects at once, you need a tree grid: a table whose rows expand to reveal the records below them. You can build one with code, or configure one without it. This post covers both, and what the native view already does well.
On any account with a parent, the View Account Hierarchy action opens a page that shows the whole family: the parent, its children, and theirs. Admins pick up to 15 columns for it, and it displays up to 2,000 accounts. For a quick look at who owns what in a group of companies, it does the job.
Its limits show up as soon as the hierarchy becomes part of someone's daily work:
Salesforce's Lightning component library includes lightning-tree-grid, a base component that renders hierarchical rows. A developer writes the Lightning Web Component around it, plus the Apex that queries each level and assembles the nested data. It works, and it is yours to maintain: every new level, column or object is a code change.
Avonni's Tree Grid does the same job without code. It exists as a Dynamic Component, for Lightning record, app and home pages, and as a Flow Screen Component, for Screen Flows. You configure it visually, level by level.

The levels don't have to use the same object. An account can expand into its opportunities, and each opportunity into its contact roles or products. Each level is a query on the child object, linked to its parent by a relationship field.
The Tree Grid builds the hierarchy downward, from the records its first query returns. Placed on a child account and started from that account, it shows what sits below it, not its parents. To show the whole group, start the tree from the top-level account.
| Native account hierarchy | Custom LWC | Avonni Tree Grid | |
|---|---|---|---|
| Objects | Accounts only | Any | Any, and several in one tree |
| Where | Its own page | Anywhere you deploy it | Record, app and home pages, Screen Flows |
| Columns | Up to 15 | Your choice | Your choice, with display types |
| Actions | None | Your choice | Row actions and header buttons |
| Direction | Parents and children | Your choice | Downward from the starting records |
| Code | None | LWC and Apex | None |
Yes. Any object with a lookup to itself works the same way as Parent Account ID: add a nested level on the same object with that lookup as the relationship field.
You add one nested level per generation. One of our customers runs a five-level account hierarchy built on Parent Account ID: group, subgroup, account, sub-account and agent code.
Yes. Each level queries its own object, so a tree can go from accounts to opportunities to contacts.
Not today. The tree builds downward from the records its first query returns. Start it from the top-level account to show the whole hierarchy.
The Tree Grid is part of Avonni Dynamic Components for Lightning pages and of the Avonni Flow Screen Components for Screen Flows. Install it from the AppExchange and build your first hierarchy in minutes. For every Screen Flow component, native and third party, see the Salesforce Flow Screen Components guide.
Start free with 10 production licenses. All 3 Avonni packages included.