+ Start a Discussion
Lukasz PiziakLukasz Piziak 

Record hyperlink on the VF page

Hi,
We have created VF page with two tables related to our Production Order object. Each table is dispalying the production orders depended by the status. My Production Order record name is something like this: PRO-000203. My issue is that I would like to be able to click on this record and open it. Unfortunately there is only name displayed without underscore line suggesting that this is like link.

Thanks for any help.
Below is a screen capture
User-added image 
Best Answer chosen by Lukasz Piziak
Amit Chaudhary 8Amit Chaudhary 8
Please try outputlink. Inside column tab
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_outputLink.htm
 
<apex:column headerValue="Production Order No." >
	<apex:outputLink value="/{!item.id}" target="_blank">
    	{!item.Name}
    </apex:outputLink>
</apex:column>

Please let us know if this will help u

All Answers

sandeep@Salesforcesandeep@Salesforce
Hi Lukasz, 

It is quite simple as
1. You may use command link and implement anchor tag so that you can display this field as link, 
but it is not possible to you as it is coming as object property then 
2. you just need to create a formula field on this object of text type which will return hyperlink & in this hyper link you can use Record id url of this record.
I have used second approach in some of my work.

Thanks
Sandeep Singhal
http://www.codespokes.com/
Lukasz PiziakLukasz Piziak
Hi Sandeep,
Thank you for help.

I have tried the first option and it wasn't working for me.
Second option and here I have a question. You said return type as TEXT, from where I can get this Record id url of the record?
Amit Chaudhary 8Amit Chaudhary 8
Please try outputlink. Inside column tab
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_outputLink.htm
 
<apex:column headerValue="Production Order No." >
	<apex:outputLink value="/{!item.id}" target="_blank">
    	{!item.Name}
    </apex:outputLink>
</apex:column>

Please let us know if this will help u
This was selected as the best answer
Lukasz PiziakLukasz Piziak
Thanks Amit, it is working for me now.