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
Glenn at MvistaGlenn at Mvista 

Link to detail page from object using custom controller in Customer Portal

I have created a short list for display on our customer Portal Home Page of the last 5 cases updated by support and I want to include a link to the case detail page from this list.  The Controller queries for the only 5 cases, sorted by last updated and returns the Id field in addition to the others.

 

<apex:page controller="CP_Cases_WOC_Controller" sidebar="false" showHeader="false">
    <apex:pageBlock title="5 Most Recently Updated Cases" mode="list">
      <apex:pageBlockTable value="{!cases}" var="c">
        <apex:column value="{!c.CaseNumber}"/>
        <apex:column value="{!c.Status}"/>
        <apex:column value="{!c.Subject}"/>
      </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 I want to have the CaseNumber be a link to the Case Detail page.  How can I do that?

Best Answer chosen by Admin (Salesforce Developers) 
Hengky IlawanHengky Ilawan

Hi Glenn,

 

Try:

<apex:column>
    <apex:outputLink value="/{!c.Id}">{!c.CaseNumber}</apex:outputLink>
    <apex:facet name="header">Case Number</apex:facet>
</apex:column>

Regards,

Hengky

All Answers

Hengky IlawanHengky Ilawan

Hi Glenn,

 

Try:

<apex:column>
    <apex:outputLink value="/{!c.Id}">{!c.CaseNumber}</apex:outputLink>
    <apex:facet name="header">Case Number</apex:facet>
</apex:column>

Regards,

Hengky

This was selected as the best answer
Glenn at MvistaGlenn at Mvista

That worked.  Thank you very much.