You need to sign in to do that
Don't have an account?

click a record redirect to detail page
hi,
In vf page there are few records and i need to click on the "id" the record and it must redirect to the record detail page.
Please lt me know how to achieve this
In vf page there are few records and i need to click on the "id" the record and it must redirect to the record detail page.
Please lt me know how to achieve this
Here is the code
All Answers
You need to pass "id" of the record on the click event(using action function) in order to redirect to record detail page and use PageReference Object to redirect the page as shown below.
PageReference pf = new PageReference('/' + <id>);
pf.setRedirect(true);
return pf;
You can also use javascript for this task. All the record detail page in salesforce have URL pattern
https://<server-instance>.salesforce.com/<record-id>
So you can redirect the page on above link by dynamically passing <record-id>
Thanks for your mail.
I have done it by passing the id(apex:param) to the page reference.
But the issue is it is a inline vfpage. and it is redirecting in same section rather than opening in a new page
Here is the code
i have written the code like this
<apex:outputlink onclick="window.open('/{!v.id}','_blank')">{!v.id}</apex:outputlink>
it is displaing in anothet tab. so this is wirking fine.
But issues on the existing vf page that is inline vfpage it is saying as "URL DOES NOT EXIST"
I just forgot to mention the value="#". so i just added it and now its working fine.
Thanks for the help.