You need to sign in to do that
Don't have an account?
Rishav
how to convert a record into a link and show the detail page of that record after clicking on record
How to convert a record into the link in visualforce pages and when i click on that it should redirected to the detail page of that record.
suppose that i am having a visualforce page and i am fetching the account record in that page like below :
name industry site location
---------------------------------------------------------------------
ram IT ram.com Newyork - 1st record
Bell Education bell.com Alaska - 2nd record
now every record should be as a link in visualforce page and when i click on that record it should show the detail page of tha record. please help
suppose that i am having a visualforce page and i am fetching the account record in that page like below :
name industry site location
---------------------------------------------------------------------
ram IT ram.com Newyork - 1st record
Bell Education bell.com Alaska - 2nd record
now every record should be as a link in visualforce page and when i click on that record it should show the detail page of tha record. please help
I assume that you are using either pageblocktable/datatable to render these values in the form of a table. If it is so, then you can simply change the first column i.e. name with the tags similar to given below:
<apex:column style="text-align:center;">
<apex:facet name="header">Name</apex:facet>
<apex:commandLink action="{!RedirectToPage}" value="{!var.name}" id="theCommandLink">
<apex:param name="RecordId Id" value="{!var.Id}" assignTo="{!RecordId}"/>
</apex:commandLink>
</apex:column>
Here RedirectToPage is controller method which will be used to redirect to new page as given below:
public string RecordId{get;set;}
public pagereference RedirectToPage()
{
pagereference pageref = new pagereference('/'+ RecordId);
pageref.setRedirect(true);
return pageref;
}
Please let me know if you need any other help on this.
--
Regards,
Grazitti Team
Web: www.grazitti.com
All Answers
I assume that you are using either pageblocktable/datatable to render these values in the form of a table. If it is so, then you can simply change the first column i.e. name with the tags similar to given below:
<apex:column style="text-align:center;">
<apex:facet name="header">Name</apex:facet>
<apex:commandLink action="{!RedirectToPage}" value="{!var.name}" id="theCommandLink">
<apex:param name="RecordId Id" value="{!var.Id}" assignTo="{!RecordId}"/>
</apex:commandLink>
</apex:column>
Here RedirectToPage is controller method which will be used to redirect to new page as given below:
public string RecordId{get;set;}
public pagereference RedirectToPage()
{
pagereference pageref = new pagereference('/'+ RecordId);
pageref.setRedirect(true);
return pageref;
}
Please let me know if you need any other help on this.
--
Regards,
Grazitti Team
Web: www.grazitti.com
In above record detail page how to display customly?