You need to sign in to do that
Don't have an account?
cFang
Adding Hyperlinks to a Custom Related List
I have a custom related list that I have setup with the APEX page code below. The problem is that the custom related list does not include hyperlinks to the related items. In this case, I have created a custom list that displays opportunities that are associated with the same account as the contact is. The problem is that a user cannot click the associated opportunity and navigate to that page. What do I need to add to get hyper link functionality? Any help is greatly appreciated.
<apex:page standardController="Contact" extensions="sampleDetailPageCon"> <style> .fewerMore { display: none;} </style> <apex:form > <apex:pageMessages /> <apex:detail relatedList="true"></apex:detail> <apex:pageblock id="CustomList" title="Related Opportunities" > <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}"> <apex:column value="{!o.Name}"/> <apex:column value="{!o.Account.Name}"/> <apex:column value="{!o.Type}"/> <apex:column value="{!o.Service_MRR__c}"></apex:column> <apex:column value="{!o.CloseDate}"/> </apex:pageBlockTable> <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel> </apex:pageblock> </apex:form> </apex:page>
All Answers
Hi CFang,
Use below format to display hyperlinks.
<apex:column headerValue="Opportunity Name">
<apex:outputlink value="/{!o.Id}" target="_parent">
<apex:outputText value="{!o.Name}"/>
</apex:outputLink>
</apex:column>
Thanks
I went ahead and inserted it but it still isn't working. Here is the code. What am I doing wrong?
Is it possible to do it for the Account name as well? As you can tell, I'm pretty new at this. Thank you for your help.
Thanks for your help kkr.dev. I appreciate it. This is great.