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

Adding a link to a record on an email template
Good afternoon community,
So on a Visualforce Email template I'm trying to add a link back to the record detail page, with:
<apex:outputLink value="{!URLFOR($Action.Lead.View, relatedTo.id)}">
</apex:outputLink>
where related to type is my standard Lead object. on Saving this template i continue to get this error:
Error occurred trying to load the template for preview: Invalid parameter for function URLFOR. Please try editing your markup to correct the problem
I'm not a developer by trade so not sure how to correct this, would appreciate any feedback regarding how to fix ....
thanks everyone
or check this out
https://success.salesforce.com/answers?id=90630000000gjpYAAQ
All Answers
Make it simpler for yourself and just have value="your-instance.salesforce.com/{!relatedTo.id}"
or check this out
https://success.salesforce.com/answers?id=90630000000gjpYAAQ
Thanks Val,
I appreciate the given direction, i'll just have to change my template from VF to HTML but think that it'll work.
I have a better solution for you I've used as a workaround until salesforce fixes this. Create a Visualforce Component (make the access level global), then you can referense an apex controller through the component. From the controller expose a property or method which calls to Url.getSalesforceBaseUrl().toExternalForm() as the previous person had mentioned.
This way you can keep the Visualforce Email Template and not be forced to convert to another template type.