Admins / RevOps / Sales / Sales Cloud

How to Build a Salesforce Account Hierarchy

By JP Leggett

The Salesforce Account Hierarchy is an out-of-the-box Salesforce feature that enables users to relate Account records to one another, to represent parent companies and their subsidiaries. You can use the Account Hierarchy in Salesforce to rapidly implement a visualization of how companies are structured within your Salesforce org.

Whether you’re a new Salesforce Admin, or you’re well into your Salesforce journey, it’s likely you will have come across Salesforce Account Hierarchies, and also have plenty of questions around this functionality. Let’s first introduce why Account Hierarchies are powerful, then show you how to build your own in Salesforce. 

What is a Salesforce Account Hierarchy?

The Salesforce Account Hierarchy feature shows how Account records relate to one another, to represent parent companies and their subsidiaries (each represented by an Account). Accounts can be organized in a layered way as they are grouped based on criteria (e.g. Country, State, or perhaps by division).

Note: This guide will explore Salesforce Account Hierarchies in Lightning Experience, but this is available in Salesforce Classic in case your org has not migrated to Lightning. 

How to access the Account Hierarchy in Salesforce Lightning vs. Salesforce Classic.

Why Use an Account Hierarchy in Salesforce? 

An Account Hierarchy is one of the easiest ways to make sure Business Accounts in Salesforce are organized in a clear way, and provide access to records for users. 

Note: Account Hierarchies are not available when using Person Accounts. 

There are many companies, especially big conglomerates, which have numerous legal entities, each with its own subsidiaries. We all know this about companies such as Disney, Accenture, and even Salesforce – the easiest way to translate these structures into your CRM is by making use of a Parent/Child relationship between Accounts. 

Even if you would like to go more granular and include divisions, multiple geographical locations, or maybe both, this can rapidly be implemented by using a combination of these standard fields: 

  • Parent Account: A field that ‘looks up’ to another Account, therefore relating the two records. 
  • Account Site: A field that can help identify the type of entity the current Account is, such as a Branch (used below) or perhaps Headquarters. Since it’s an 80-character standard text field, each organization can have their own guidelines for using this field independently if that is desired.

Account Hierarchy Fields and Permissions

The basic access and settings required for users to successfully start using the Account Hierarchy are as straightforward as it gets: 

  • Read on the Account object: This can be granted either through the profile or permission set.
  • Read on the Parent Account standard field: This will be the one field that dictates the hierarchy, established at each Account’s level.
  • Write on the Parent Account standard field: Required permissions for users to be able to update the hierarchy. 
  • Either the Account Hierarchy action or the button added to the Account layout is assigned to users who need to view the hierarchy. 

Note: When viewing the hierarchy, users will only see the Accounts they have at least view access to, through permissions, sharing rules, or other means. 

Use Dynamic Actions

There is always one step further using other Salesforce functionalities, such as Dynamic Actions, to granularly control the action’s visibility on the Record Page. 

For example, both Sales and Support teams use the Account object, but the Support team does not need access to the Account Hierarchy. Since Dynamic Actions are enabled on our Account Record page, the action can be hidden for the Support team’s profile through a filter.  

Later, we will get into more customization options. 

Build Your Salesforce Account Hierarchy

Since we’ve gone through the theory, it’s time to get hands-on. Setting up an Account hierarchy in Salesforce is as easy as it sounds. 

Before going ahead, make sure that the View Account Hierarchy action (Lightning) or button (Classic) is on the layout assigned to every user profile that needs to access the Salesforce Account Hierarchy. 

As soon as the correct level of record access, permissions, and layouts are in place, the rest will certainly be a walk in the park. Let’s start with viewing the initial hierarchy, which only has one Account. 

Out of the box, the Account Hierarchy and Recently Viewed Account list view share the exact same columns – we’ll get into how to control these later on! 

By completing the Parent Account and Account Site (optional) fields on each Account, you will see the hierarchy taking shape when clicking View Account Hierarchy.

The same steps can be repeated until the hierarchy reaches dozens of Accounts. Also, if this information already exists outside of Salesforce, the Admin can help populate the Parent Account field even faster through an import with the Data Import Wizard or Data Loader. 

Account Hierarchy Limitations

While they are ready to use, and can rapidly accommodate your org’s needs, there are a few Account Hierarchies limitations to keep in mind:

  • Account Hierarchies are not available for Person Accounts.
  • A maximum of 2000 Accounts are displayed on the Account Hierarchy page.
  • Account Hierarchies cannot be viewed on the Salesforce Mobile App.

Note: Ensure you take a look at the considerations page from the Salesforce official documentation, as Salesforce may resolve these limitations.

Customize the Salesforce Account Hierarchy 

Now that you have a clear overview of Account Hierarchies and know how to use them, what’s next? Similar to many other out-of-the-box features, this one is powerful and gets the job done – but processes, as well as the user experience, can be improved. 

There will be times when organizations will need to go beyond the standard Salesforce Account Hierarchy and build one using custom development to fit their specific needs.  

Ultimate Parent Formula

One of the easiest things to pull off is the Ultimate Parent formula. This is a formula field that will contain either the Name or another field value from the highest Account in the hierarchy. This formula can reach a maximum of 10 levels deep – which is plenty for even the larger, more complex hierarchies!

Since I know that my hierarchy won’t contain more than three levels, I’ve created this nested IF() formula field to cater for that (if the maximum number of hierarchy levels goes higher, the formula can be changed accordingly):

This formula field can be displayed on all Account records by adding it to the layout. 

Below, I’ve taken a screenshot of the three Account records in the hierarchy (child, parent, ultimate parent). You can see the formula field value has been populated (or left blank) according to where the Account sits in the hierarchy. 

Note: This formula field can display whichever field you choose to have on the child accounts, which doesn’t necessarily have to be the Account name.

Account Hierarchy Page

Even with the new Ultimate Parent Account field, it makes sense to add this information on the Account Hierarchy page, especially if the standard fields are not necessarily used within this Salesforce org.

For example, you can choose which columns are displayed on the Hierarchy Columns tab when editing the Account object. Here, you can create a custom view that will become accessible when a user clicks on the View Account Hierarchy action.

Not only will the relevant information be displayed for Sales Reps, but missing critical data points will be obvious. In the example below, you can see that we are missing the Annual Revenue value for the child Account: 

Complex Account Hierarchies (Using APEX)

Customizations can get so much more complex, if you are able to write APEX code or create Lightning Web Components to achieve a totally tailored Account Hierarchy (you will need to seek a Salesforce Developer to achieve this).

Third-Party Options

Sometimes, it’s either impossible or not logical to build your perfect custom hierarchy in-house – that’s when the AppExchange comes into play. You can find vendors who have taken the Account Hierarchy to the next level, to make this feature more visual and interactive.

Summary

I’m sure Salesforce Account Hierarchies are not going anywhere anytime soon. This way of organizing Salesforce Accounts is widely used by many organizations across the globe.  Depending on your needs, you have multiple options to choose from. You could use the out-of-the-box feature, customize the view, or opt for a third-party app.

The Author

JP Leggett

JP Leggett is the CEO and Founder of Squivr.

Comments:

    MJ Kahn
    March 02, 2022 10:48 pm
    Great summary of Account Hierarchies! I've written formulas to get the Id of the ultimate parent Account and ran across a few things. First, you can only go so deep - if your hierarchy needs to be deeper than 5 levels, the formula won't cut it. Second, if the formula returns the ID of the ultimate parent, that'll be a 15-character Id; you can't use CASESAFEID to get the 18-character Id since that will run into a formula size limit.
    Ann
    March 10, 2022 8:52 pm
    Very helpful. Thank you. I have a question, what if after setting up a simple 2 level parent /child account hierarchy, I only want the opportunities to be opened under the child account. In other words I do not want the ability to click new opportunity on parent accounts. ( I have tried unsuccessfully to create a validation rule. Not sure if that is even the right track) thanks for any input:)
    KM Ward
    October 26, 2022 3:56 pm
    This is great for internal use. However, Salesforce still has a long way to go for making use of Account Hierarchies in the Partner Community. When the Experience Sharing Setting only allows ONE Criteria for sharing an object, you are limited to choosing whether you want to see accounts that match your account, OR accounts with a Parent that match your account, OR accounts with a parent.parentid that match your account, but not all 3, or worse yet higher. (And you can't use the helpful "ultimate parent field" created in this article to get around that.) This limits you to One level only, on EVERY Object. You basically have to pick one, and then share the rest manually using Salesforce Classic. I shudder to think that they may eventually take classic away, when there are still so many shortcomings in Lightning.

Leave a Reply