0

Background

I am trying to add a dynamic link in a visualforce email template to download a PDF which is stored as a publicly available Static Resource:

<a href="https://x.cs.force.com/site/{!URLFOR(relatedTo.Static_Resource_Name__c)}">Download PDF</a>

But it doesn't generate a valid URL:

https://x.cs.force.com/site/resource_name?isdtp=p1

Question

  1. Is it possible to set URLFOR dynamically?
  2. How can I create a link which has a dynamically generated link to different static resources?
1

It's possible with this URL:

<a href="https://x.cs.force.com/site/resource/{!relatedTo.Static_Resource_Name__c}">Download PDF</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.