+ Start a Discussion
JN22JN22 

Output Account Name Rather than Account ID

Hello,

 

I have a VF page that shows the Company Name, which is a lookup field to the Account Name.  When I use the code below, it only shows the Account ID.  Can anyone tell me how to get it to show the company name, preferably as a link to the Accoun?  Thanks,

 

    <apex:pageBlock title="{!Client_Status__c.Client_Name__c}" >
        <apex:pageBlockSection title="STATUS" collapsible="FALSE" columns="2" >
                   Client Name:
                   <apex:outputLabel Value="{!Client_Status_Scorecard__c.Client_Name__c}"/>
        </apex:pageBlockSection>

Best Answer chosen by Admin (Salesforce Developers) 
sfdcdev69sfdcdev69

Try some thing like this:

 

Client_Status_Scorecard__c.Client_Name__r.Name

 

 

All Answers

sfdcdev69sfdcdev69

Try some thing like this:

 

Client_Status_Scorecard__c.Client_Name__r.Name

 

 

This was selected as the best answer
JN22JN22

Thanks, that did the trick!  I knew it would be something simple.  I always forget about the related variables.  Thanks,