You need to sign in to do that
Don't have an account?
symantecAP
Attaching ID to the hyperlink
Hi Developers.
Here is my requirement, As to How can I attach the record ID to the Link. I am displaying list of product code and Product name as link on a VF page and its a custom comtroller. How do i pass on the link so that once when click the product code or name it redirects to the record
Here is my VF code.
<apex:page controller="ProductPriceBook23" tabStyle="Product2"> <apex:pageBlock > <h1><u>Report : Products and PriceBooks for Region= NA and Product Family=PRODUCT </u> </h1> </apex:pageBlock> <apex:pageBlock > <apex:pageblockTable value="{!products}" var="product"> <apex:column headerValue="Product Code" width="150"> <apex:outputLink value="https://c.cs4.visual.force.com/"> {!product.prod.ProductCode} </apex:outputLink> </apex:column> <apex:column headerValue="Product Name" width="500"> <apex:outputLink value="https://c.cs4.visual.force.com/"> {!product.prod.name} </apex:outputLink> </apex:column>
Thanks All
While that is more dynamic than hard-coding the domain info, i don't believe you need to have that...
Example below shows how i have been handling dynamic links. it's simple and it seems to work well.
All Answers
All you do is add the id of the record to the end of your URL. You may have to modify the controller to make it work depending on how the controller is written, but your VF page could look like this:
For more dynamic url, Add below to your code:
Class:
Page:
While that is more dynamic than hard-coding the domain info, i don't believe you need to have that...
Example below shows how i have been handling dynamic links. it's simple and it seems to work well.
The urlfor function is the official supported way to get the url for going to a standard page.
Thanks every one. ..I tried <a href="/{!product.prod.id}">{!product.prod.name}</a>
Its magic .. Beauty of development.
Thanks for reminder,
I almost forgot that. :)