You need to sign in to do that
Don't have an account?
Edwards71
Visualforce outputlink field not registering as a link
Hi,
I've got an apex:outputlink field linked to a records ID that I want a user to click on and open up the detailed record page. The visualforce page is rendered as a PDF.
The ContractNumber appears in blue on the PDF but does nothing when you click on it.
Any ideas why? Do I need to specifiy the salesforce URL as its rendered in PDF?
Thanks in advance
<apex:pageBlockTable value="{!ContractListing}" var="cl" cellpadding="10" rules="all" styleclass="pageblock" > <apex:column headervalue="Ref"> <apex:outputLink value="{/!cl.id}" target="_blank">{!cl.ContractNumber}</apex:outputLink> </apex:column>
You need to use the full record link thaan the relative link. ALso when some one clicks on the link they may be prompted to enter user name and password. If you dont want this then you have couple of options:
create a salesforce site and edit url id PDF accordingly
Provide complete url with user/pass if it is internal for your reference..
Thanks - is there some dynamic code I can add to pick up the salesforce instance/URL to my code or do I have to hard code it?
Hi,
Please look at $site global variable.... {!$site.prefix}
Refer to : http://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_global.htm
interestingly some fields in the PDF are automatically hyperlinked just from the apex:column value alone - e.g. OwnerID, WhatID from Tasks object. Why would some fields be auto-linked and others need to use outputlink?
Thanks
Thanks - I've not been able to use $page to get this sorted.
How do I replace https://cs11.salesforce.com (my sandbox instance which I need to it to change when published into production instance) with something dynamic? The hard-coded example below works fine.
Thanks
Yes, if it is Lookupfield or name field in object and you used outputfield then it will show as link in PDF.
Please read the $SIte section from salesforce documentation(Link : http://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_global.htm) and use the right one for your requirement...