Blog

The Salesforce account hierarchy allow accounts to be related in a hierarchy by using a 'parent account' field to link them together. Once linked, the complete hierarchy structure can be viewed and links are provided to navigate directly to the accounts.

The first step is to create or identify the ultimate 'Parent' account. This is the account at the top of the hierarchy. In our example, the top level account is Acme.

Parent Account

Then one or more accounts are created or linked to each level of the hierarchy, using the Parent Account field. In our example, we are linking Brown Company to the top level account Acme.

Setting Parent Account

Once the hierarchy has been built, the 'View Hierarchy' link can be used to view all of the accounts that have been related to each other in a separate page. In our example we have 11 levels, probably more than you would need. Accounts are indented to show the different levels.

Account Hierarchy

Now that a multi-level hierarchy has been built, a common requirement is to identify the 'ultimate parent' for each account in the hierarchy. For example, if we are looking at the Ice Company record, we want to know what is the company at the top of the hierarchy that the Ice Company belongs to. We can do this by adding a text formula field to the account object.

Ultimate Parent Formula Field

Copy the formula from the textbox below into the formula field just created. It will check up to 10 levels for the ultimate parent.

IF( LEN(Parent.Name)<1 ,HYPERLINK("/"&Id, Name,"_parent"),

IF( LEN( Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Id,Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Id,Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Id,Parent.Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Parent.Id,Parent.Parent.Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Parent.Parent.Id,Parent.Parent.Parent.Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Parent.Parent.Parent.Id,Parent.Parent.Parent.Parent.Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Parent.Parent.Parent.Parent.Id,Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Id,Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name,"_parent"),

IF( LEN( Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name )<1 ,HYPERLINK("/"&Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Id,Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name,"_parent"), "Ultimate Parent Beyond 10 Levels"))))))))))


Here is the account page layout with the 'Ultimate Parent' field added. As Acme is the top level, it is listed as the ultimate parent.

Ultimate Parent

Here is an example of how the ultimate parent formula works at one of the levels of the hierarchy. The Jelly company has a parent of the Ice Company and the ultimate parent is displayed correctly as the Acme account.

Jelly-Ice

Our formula stops at 10 levels, so for the Kandy company, a message is displayed that the ultimate parent is beyond 10 levels.

Ultimate Parent Beyone 10 Levels

Some things to keep in mind when using the Account hierarchy:

  • The parent account hierarchy is not supported for person accounts
  • There is a limitation of displaying up to 500 accounts
  • If the user displaying the hierarchy doesn't have access to the account data, the additional columns displayed to the right of the account name won't be displayed
  • A Custom Report Type will be needed to report on hierarchies more than one level deep
  • The “View Hierarchy” page is not editable. This means you are cannot change the columns that are displayed e.g. Type, Industry, Billing City, Billing State and Owner. If you do want a custom view you will need to create a custom Visualforce page or look for an app in the AppExchange.
  • One account can’t have multiple direct parents

What Certification are you studying for now?

Focus on Force currently provides practice exams and study guides for sixteen certifications.

What is the Salesforce Account Hierarchy (And How To Use it)

The Salesforce account hierarchy allow accounts to be related in a hierarchy by using a ‘parent account’ field to link them together. Once linked, the complete hierarchy structure can be viewed and links are provided to navigate directly to the accounts.The first step is to create or identify the ultimate ‘Parent’ account. This is the account at the top of the hierarchy. In our example, the top level account is… Read More

What is the Salesforce Account Hierarchy (And How To Use it)

Data Loader Tips – Inserting or Updating Blank Values in a Field

You may have come across the situation where you need to use Dataloader to clear or delete the value of a field. Normally, if you provide a blank value in the input file, DataLoader will ignore it and leave the field value as is. Lets look at an example. Here we have loaded data into the Product Description field instead of the Product Code field. Lets imagine, instead of 3… Read More

Data Loader Tips – Inserting or Updating Blank Values in a Field

Salesforce Multicurrency – What You Need to Know

      What is Salesforce multicurrency?Before we look at how multicurrency works and what you need to look out for, lets look at what it offers:Adds the ability to record amounts in different currencies. If you don’t have multicurrency enabled, then amounts are just displayed as an amount.Allows amounts to be converted, displayed and reported according to exchange ratesAllows the use of dated exchange rates so the value at… Read More

Salesforce Multicurrency – What You Need to Know

Preventing Duplicate Records with Salesforce Config

The Salesforce mantra is ‘clicks not code’ so we always look for a config solution to a problem before resorting to code. While we can set the unique indicator on a custom field to prevent duplicate values for one field across records, how do we prevent records inserted with duplicate values across all or some of the fields? Do we need to write a trigger to handle this? Or is… Read More

Preventing Duplicate Records with Salesforce Config

Salesforce Case Management

In most every company which prides itself on taking care of its customer base to the fullest, the Salesforce native functionality of Case Management goes hand in hand with customer success. The departments in an organization that deal with customer service, product support, issue resolution and service requests can all benefit from utilizing the case management functionalities; and related automation options; within Salesforce. As described in Salesforce Service Cloud Overview … Read More

Salesforce Case Management

Using DataLoader with Lookup Fields

External Ids provide a convenient way to integrate data from an external system, by allowing the use of a unique record identifer for records instead of the Salesforce Id. For example, you may define an Account Code external id on the Account object, which is the unique key for an account record in an ERP system that is integrated with Salesforce. When using DataLoader or another integration tool to update… Read More

Using DataLoader with Lookup Fields

Salesforce Mass Email

When you hear that Salesforce has a mass email capability you may think that you don’t need a marketing automation package to do that for you. Dig a little deeper and you will find that although Salesforce can send mass emails, there are a number of limitations that may have you looking back at AppExchange products. Firstly, lets look at what you can do with Salesforce mass email capability. You… Read More

Salesforce Mass Email

Quick Start Guide to using Conga Composer with Excel

Conga Composer is one of the most widely used 3rd party AppExchange apps for document generation with Salesforce. It can be used to merge Salesforce data to produce documents in Word, Excel, Powerpoint, HTML Email and PDF format. Here is a quick guide to generating an Excel spreadsheet with data from Salesforce. Create Your Excel Template Define the Fields and Reports it will use Add Merge Fields to the Excel… Read More

Quick Start Guide to using Conga Composer with Excel

How to Delete Multiple Records from a Salesforce Related List

You may be faced with the situation where you need to be able to delete multiple records from a related list in one click. Standard related lists do not have a feature to select all and delete all selected records. The standard way to delete from a related list is to use the del link and delete each record individually. This can be very time consuming and tiresome if there… Read More

How to Delete Multiple Records from a Salesforce Related List

Salesforce Cross Filter Report Examples

You may have come across cross filters when learning about Salesforce reports but having no immediate need for them, forget about them. It is only sometime later when faced with a reporting challenge that you may delve back and find that they are very useful and may even solve a problem that you thought you could not do with Salesforce reports. Lets review what reports with cross filters can do:… Read More

Salesforce Cross Filter Report Examples

Salesforce Email Templates

When you send an email from Salesforce, such as when you use the Send Email button or triggered from a workflow, you can select an email template. Email Templates in Salesforce come in four different types: Plain Text HTML using Letterhead HTML Custom Visualforce Plain Text Email Template This is the simplest email template to create. You can create it very quickly by entering the email text and including the… Read More

Salesforce Email Templates

Salesforce Lead Conversion

I was looking for a process flow diagram, that describes what happens when a lead is converted in Salesforce. I couldn’t find one, so I made my own. Once a lead is qualified, the next step is to convert the lead. In Salesforce, when you convert a lead, there are a number of options that are part of the process flow. The first step is to press the convert button…. Read More

Salesforce Lead Conversion

How to Display a Traffic Light Indicator in Salesforce

Visual indicators are a great addition to a Salesforce page to highlight important information or values. Instead of just displaying a value, showing an image will make a much larger impact. Depending on the situation, it may be more suitable to just display a single indicator such as a caution or stop image, or if a variable can have a range of values, display a variable image according to which… Read More

How to Display a Traffic Light Indicator in Salesforce

Salesforce Platform Overview

There are a number of features and functionality that are part of the Salesforce platform and are available to all Salesforce solutions. They offer the technology or functionality that can be used either standalone (e.g. content management) or used to build upon (e.g. force.com code). As they are common across the different Salesforce applications (e.g. Sales Cloud, Service Cloud and custom applications) they are part of the Salesforce platform. The… Read More

Salesforce Platform Overview