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

How can provide link to a record from visualforce page
Hi,
I have a VF page which has a list of records. I would like to have a hyperlink on any one field to link to that record.
For eg. if the list has a list of opportunities and i would like to point the opportunity name to be hyperlinked to that opportunity record.
Thanks
Prady
You can do this via the outputLink component, using the opportunity id.
Something like:
replace "opportunity" with your var name.
Thanks Bob...
I was wondering how could i use outputlink in this scenario.
I want to show the link only if slot.sAppointment or slot.sAppointmentOverlap is not null.
Any idea how to approach this.
Thanks
Hi Bob and other Visual force gurus,
I am creating 2 pages in VF. One page to display a list of custom object records from a dynamic search. This is complete.
I need to now create a custom VF page to display a single record information when a user clicks on a link on the list page.
Assuming I have built the detail page (assume its path is "apex/customDetailPage"), how would I go about creating this link. Because my detail page will need the selected record id passed to it I suppose.
Thanks,
Calvin
Hi Calvin,
You could do this by
In your controller of the VF page you could capture this id using
Now that you have the id you can query the record and assign the values to the VF page fields. there may
be other ways to approach this, but the above method should work.
Note: Pls check the syntax as i wrote this on the fly
Its better practice to use the $Page global variable when producing links to other VF pages. I also tend to use URLFOR to generate the parameters etc. It doesn't make a huge amount of difference in this case, but its a good habit to get in to:
<apex:outputLink value="{!URLFOR($Page.customDetailPage, '', [id=opportunity.id])" />
Thanks a ton Prady and Bob for your replies. I think I should have my answer now and will keep the URLFOR method in mind.
Hi bob,
If i use this, i am redirected to URL No Longer Exists page. Following is my page code.
<apex:dataTable value="{!Data}" var="o" id="scoringTable" cellpadding="4" width="100%">
<apex:column >
<apex:facet name="header">Owner Id</apex:facet>
<apex:outputLink value="/!{o.owner_id}">{!o.owner_id}</apex:outputLink>
</apex:column>
</apex:dataTable>
Am i missing anything?
Please help me.
Thanks,
S.Sivakumar
Are these records all owned by users, or are any of them owned by queues?
If i append the id along with url https://ap1.salesforce.com/ and load it using browser , i am able to get the records.
But i cant provide a link to the same record from visualforce page.
Thanks,
S.Sivakumar
You have a typo in your merge field:
should be :
Thanks bob.
Its working
Regards,
S.Sivakumar
I am trying to use
My requirement is In output panel i want to show list of opportunities as link and clicking on that link it should redirect to the detail page.
ListOpportunity - is coming from Apex class.
This page is not build on Opportunity standard controller. It on some different object and apex class takes care of displaying the listOpportunity
Its giving me
when you are using the below code remove the <u> tags. this would work
<apex:outputLink value="/{!opp.id}">{!opp.name}</apex:outputLink>
How can I use OutputLink to direct to a visualforce page with related list. My VF page shown apex form content only, it will not shown related lists. Please suggest required change in my code
<apex:column>
<apex:outputLink value="/{!URLFOR(opp.Id)}">{!opp.MasterLabel}</apex:outputLink>
</apex:column>