+ Start a Discussion
Rahul Gupta 176Rahul Gupta 176 

i have a vf page having account name email and owner so i want to hyperlink on account name please help me

<apex:page controller="clsAccountControl" >

<apex:form >
        <apex:pageBlock title="Account Details" >
            <apex:pageBlockTable value="{!acclist}" var="a" id="mid" >
            
                <apex:column value="{!a.Name}" headerValue="Account Name" />
                
                 <apex:column value="{!a.OwnerId }" headerValue="Owner" />
                <apex:column value="{!a.Custom_Emaail__c }" headerValue="Email" />
                
                <apex:column value="{!a.BillingCity }" headerValue="BillingCity " />
                
            </apex:pageBlockTable>
           
        </apex:pageBlock>
        
    </apex:form>

  
</apex:page>





-------------------------------------------------------------------
public class clsAccountControl 
{

 public List<Account> acclist {set;get;}
 
 public clsAccountControl()
 {
     acclist=[Select Name,BillingCity,Custom_Emaail__c ,OwnerId from Account LIMIT 10 OFFSET 10];
 }
 
 
 
  
}

 
Best Answer chosen by Rahul Gupta 176
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Just replace 
<apex:column value="{!a.Name}" headerValue="Account Name" />
with 
<apex:outputLink value="/{!a.Id}" target="_top">{!a.Name}</apex:outputLink>

All Answers

Lokesh KumarLokesh Kumar
Hi Rahul,

Please try the below code I have updated accordingly using outline.
global class Miko_Scheduled Implements Schedulable
    {
        global void execute(SchedulableContext sc)
        {
            doexecute();
        }

        public void doexecute()
        {
            list<PersonalGoals__c> AllRecords = new list<PersonalGoals__c>();
			AllRecords = [select Id from PersonalGoals__c where Q_check__c = TRUE];
			update AllRecords;
		}<apex:page controller="clsAccountControl" >

<apex:form >
        <apex:pageBlock title="Account Details" >
            <apex:pageBlockTable value="{!acclist}" var="a" id="mid" >
            
                <apex:outputLink value="/{!a.id}" id="theLink">{!a.Name}</apex:outputLink>
                
                 <apex:column value="{!a.OwnerId }" headerValue="Owner" />
                <apex:column value="{!a.Custom_Emaail__c }" headerValue="Email" />
                
                <apex:column value="{!a.BillingCity }" headerValue="BillingCity " />
                
            </apex:pageBlockTable>
           
        </apex:pageBlock>
        
    </apex:form>

  
</apex:page>





-------------------------------------------------------------------
public class clsAccountControl 
{

 public List<Account> acclist {set;get;}
 
 public clsAccountControl()
 {
     acclist=[Select Id,Name,BillingCity,Custom_Emaail__c ,OwnerId from Account LIMIT 10 OFFSET 10];
 }
 
 
 
  
}


Happy to help you !
Rahul Gupta 176Rahul Gupta 176
is there any easy way to do this because i m learning vf page . Just started today
Lokesh KumarLokesh Kumar
HI Rahul,

You can learn visualforce code through developer.salesforce.com forum or try habit of solving trail from trailhead.salesforce.com.

And if the above solution worked for you please mark it best answer.

Happy to help you !!
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Just replace 
<apex:column value="{!a.Name}" headerValue="Account Name" />
with 
<apex:outputLink value="/{!a.Id}" target="_top">{!a.Name}</apex:outputLink>
This was selected as the best answer