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
etessetess 

Opportunity Account Not Displaying a Link?

I have a visual force page with an Opportunity standard controller.

 

The following code displays the proper information, but is not displaying as a link to that Account.  However, my custom lookup fields to other accounts are displaying properly and linked to their respective Account records. What am I missing here?

 

<apex:outputField value="{!opportunity.Account.name}"/>

 

 

Best Answer chosen by Admin (Salesforce Developers) 
John De SantiagoJohn De Santiago

You should only need to specify the accountid field for it to properly display a link to the account

 

 

<apex:outputField value="{!opportunity.AccountId}"/>

 

The output field should automatically see that it is a reference field and render the appropriate label and name value as a link. 

 

All Answers

John De SantiagoJohn De Santiago

You should only need to specify the accountid field for it to properly display a link to the account

 

 

<apex:outputField value="{!opportunity.AccountId}"/>

 

The output field should automatically see that it is a reference field and render the appropriate label and name value as a link. 

 

This was selected as the best answer
Imran MohammedImran Mohammed

You should use

<apex:outputLink value="{!FieldName}">{!FieldName}</apex:outputLink>