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
SFDCLondonSFDCLondon 

Help with VF page

Below is my VF page.   Can somebody help with adding the ability to click on a result and take it to record.  

 

<apex:page controller="CampaignList2Con">
<apex:pageBlock >
<apex:pageBlockTable value="{!Campaigns}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.id}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

Chi-Towns FinestChi-Towns Finest

If you replace <apex:column value="....." /> with:

 

<apex:column>

     <apex:outputField label="<insert label here>" value="{!c.Name}" />

</apex:column>

 

you should have a link for each name. Also note, that the "label" attribute only works on version 23 and above. So you might have to remove that attribute when using this code.

 

I hope that helps!

LakshmanLakshman

Hi SFDCLondon,

 

You can do it as below:

 

<apex:page controller="CampaignList2Con">
<apex:pageBlock >
<apex:pageBlockTable value="{!Campaigns}" var="c">
<apex:column headerValue="Name">
<apex:outputLink value="/{!c.Id}" target="_parent">{!c.Name}</apex:outputLink>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 

Regards,

Lakshman