Account Hierarchy Link in Lightning Experience.

Account hierarchies, which display related accounts, can be viewed on the Salesforce Classic interface's account detail page. In the Lightning Experience, this is accessed via the quick action button. A Lightning component can also be developed to show the account hierarchy link on the detail page.

3

Account hierarchies display accounts related via parent account field.

We can see the account hierarchy link on the account detail page in salesforce classic user-interface.

2

In lightning experience, it is available through quick action button.

1

But we can also develop a lightning component that will show the account hierarchy link and we can place this component on the detail page.

ViewAccountHeirarchy:

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
<div class="slds-section slds-is-open">
<h3 class="slds-section__title">
<button aria-controls="expando-unique-id" aria-expanded="true" class="slds-button slds-section__title-action">
<lightning:icon iconName="utility:switch" alternativeText="" size="x-small" />
<span class="slds-truncate" title="Section Title"> &nbsp;Account Hierarchy Link</span>
</button>
</h3>
<div aria-hidden="false" class="slds-section__content" id="expando-unique-id">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="{!c.navigateToAccountHierarchy}">View Account Hierarchy</a>
</div>
</div>
</aura:component>

ViewAccountHeirarchyController:

({
navigateToAccountHierarchy: function(cmp, event, helper) {
var acctId = cmp.get('v.recordId');
var evt = $A.get("e.force:navigateToComponent");
evt.setParams({
componentDef: "sfa:hierarchyFullView",
componentAttributes: {
recordId: acctId,
sObjectName: "Account"
}
});
evt.fire();
}
})

Thanks

Arun Kumar

Arun Kumar
Arun Kumar

Arun Kumar is a Salesforce Certified Platform Developer I with over 7+ years of experience working on the Salesforce platform. He specializes in developing custom applications, integrations, and reports to help customers streamline their business processes. Arun is passionate about helping businesses leverage the power of Salesforce to achieve their goals.

Articles: 162

2 Comments

  1. Hi Arun,

    is this method still working today? I tried this in my development, but with an error ‘page unavailable’, the account hierarchy page can not open.
    could you verify this? Thanks in advance!

    Best Regards,
    Jialei

  2. Hi Arun,

    I tried this in my org, but it works not with the error page unavailable. Is this still working in your org? Could you check this? Thanks in advance.

    BR
    Jialei

Leave a Reply

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading