You need to sign in to do that
Don't have an account?
TheCustomCloud
How to Dynamically pull Org Instance?
<apex:image url="https://c.cs7.content.force.com/servlet/servlet.ImageServer?id={!TD_Logo}&oid={!$Organization.Id}"/>
I remove all hardcoding but this one is giving me problems. Is there a command to pull the org instance?
Either you can do like this :
"/servlet/servlet.ImageServer?id=" or if you want to get the full URL then you can use the System.URL class introduced in summer 11.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_url.htm
Thanks
Ankit Arora
Blog | Facebook | Blog Page
All Answers
any particular reason to hardcode the base url
Either you can do like this :
"/servlet/servlet.ImageServer?id=" or if you want to get the full URL then you can use the System.URL class introduced in summer 11.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_url.htm
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Using "/servlet/servlet.ImageServer?id=" doesnt work. The server you go to retrieve documents is different.
That new System.URL class did exactly what I needed, thanks!
In the class
public string docUrl = URL.getSalesforceBaseUrl().toExternalForm();
In the page
<apex:image url="{!docUrl}/servlet/servlet.ImageServer?id={!e.docImage__c}&oid={!$Organization.Id}"/>