Forum Replies Created

  • You can easily avoid having a controller by just using custom label.

    1. Create the document and note down the document Id. Mark the document externally available if needed
    2. Note down your org id (Setup > Company Information > Salesforce.com Organization ID)
    3. Crate a custom Label with the value in this format: <domain>/servlet/servlet.ImageServer?id=[docid]&oid=[OrgId]
    4. Example: cs71.salesforce.com/servlet/servlet.ImageServer?id=[docid]&oid=[OrgId]
    5. Note down the the custom label name
    6. In the visualforce page, add the below snippet
    7. <apex:form >
      <apex:image url="{!$Label.Image_URL}">
      </apex:image>
      </apex:form>
    8. <Image_URL> is the name of the custom label defined in step 3.
    9. If you don't want to use custom label, you can directly hard code the url as well in the VF page.

    Hope this helps

    • This reply was modified 7 years, 5 months ago by  Senthil. Reason: modifed #3

Popular Salesforce Blogs

Popular Salesforce Videos