+ Start a Discussion

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}"/>



Please see the below link:




Sridhar BonagiriSridhar Bonagiri



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

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

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


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


Sridhar B.




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>