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.
In lightning experience, it is available through quick action button.
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"> Account Hierarchy Link</span> | |
</button> | |
</h3> | |
<div aria-hidden="false" class="slds-section__content" id="expando-unique-id"> | |
<a onclick="{!c.navigateToAccountHierarchy}">View Account Hierarchy</a> | |
</div> | |
</div> | |
</aura:component> |
ViewAccountHeirarchyController:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
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