function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MarniMarni 

Adding custom field to AccountHierarchyTree

I am adding a custom field to the AccountHierarchyTree and have been able to successfully add this field BUT it is showing the SalesForce ID rather than the text.  The field I am adding is a Lookup field to another account so the SalesForce ID of the account is displaying when I would like the Account Name to display.  I added the following to the component but assume there is either something I need to add or use instead of apex:outputText.  Any help is greatly appreciated!  Thanks!

 

 <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value=", {!pos.account.Related_Program__c}" rendered="{!IF(pos.account.Related_Program__c != '', true, false)}"/>
Best Answer chosen by Admin (Salesforce Developers) 
Chi-Towns FinestChi-Towns Finest

You can continue to use <apex:outputText> but you have to use:

 

{!pos.account.Related_Program__r.Name} to get the name instead of the id.

 

You can use <apex:outputField> to avoid having to query for the Name field of the related record.

 

I hope this helps!

All Answers

Chi-Towns FinestChi-Towns Finest

You can continue to use <apex:outputText> but you have to use:

 

{!pos.account.Related_Program__r.Name} to get the name instead of the id.

 

You can use <apex:outputField> to avoid having to query for the Name field of the related record.

 

I hope this helps!

This was selected as the best answer
MarniMarni

That worked, thanks!