Is it possible to refer to an IMAGE in a FORMULA by 'name' instead of ID? Just in formulas - not Apex, not VF, etc.

"/servlet/servlet.FileDownload?file=" & 

TEXT( Division_Project__c ), 

"*** NO Division Logo present for " & 
TEXT( Division_Project__c ) & 
" - alert SF Administrator ASAP **" 

/* Minimal images are 400,700 */ 

It would be ideal to reduce this to a single reference without a Case being used to translate TEXT into an SFID.

imAGE( "/servlet/servlet.FileDownload?file=" & "IDW" & ".png" )

You can't do this for normal documents, unfortunately. However, you could use static resources, which would look like this:

"/resource/imageBundle/" & TEXT(Division_Project__c) & ".png",
TEXT( Division_Project__c ) & 
" - alert SF Administrator ASAP **", 

Where imageBundle is the static resource name, uploaded as a ZIP file, and each file is contained within the ZIP file.

Or, alternatively, you could write a VF page and have it redirect to the appropriate resource. That's probably more complicated than it needs to be, though; I think using a static resource would be the most most straight-forward means of creating portable values.

  • Sounds excellent. I almost resorted to just hosting the logos on a public website. :-P I'll give that a try ASAP. Thanks. – AMM Feb 9 '17 at 20:54
  • We also had to use full url path on the domain enabled org as it wasn't shown in some places (I believe it was a list view, but I could be wrong), and validation for a blank value: IF(ISBLANK( TEXT(Division_Project__c) ), '', IMAGE( LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260)) & 'resource/imageBundle/' & TEXT(Division_Project__c) & '.png', '' ) ) – o-lexi Feb 9 '17 at 21:44
  • Static Resources work SO fantastically for this. Thanks. No more SF IDs for image references. Woohoo. – AMM Mar 7 '17 at 15:07

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.