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
bikla78bikla78 

how to create a hyperlink on a vf page

i have created this vf page. How can I create a hyperlink so that when they click on subject, it takes them to the event record

 

<apex:page standardController="contact"   extensions="ActivityController">
<apex:pageBlock title="Event History" >
<apex:pageBlockTable value="{!Activities}" var="a">
<apex:column value="{!a.activitydate}" />
<apex:column value="{!a.subject}"/>
<apex:column value="{!a.whoid}"/>
<apex:column value="{!a.whatid}"/>
<apex:column value="{!a.type}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 

Sam.arjSam.arj

Please see the below link:

 

http://salesforcesource.blogspot.com/2008/11/adding-sorting-capability-to.html

 

Sridhar BonagiriSridhar Bonagiri

Hi,

 

you can modify your code like below, its working for me.

<apex:column >
   <apex:facet name="header"

         <apex:outputText value="Subject"></apex:outputText>
    </apex:facet>             
    <apex:outputLink value="[your VF name]?id={!a.id}" id="eventlink">{!a.subject}</apex:outputLink>
</apex:column>

 

[you VF Name] -- replace this with your visualforce page name.

 

Sridhar B.

 

 

GreenwGreenw

Or you simply use "/recordid" for a eventlink. Otherwise, you may get into dificulty of setting multiple StandardControllers e.g. Contact and Task in a single VF page.

 

<apex:outputLink value="/{!a.id}" id="eventlink">{!a.subject}</apex:outputLink>