I have a trigger which updates attachment id into a custom field of object X__c. I have creatted a formula field with below formula to display the attached pic

IMAGE('/servlet/servlet.FileDownload?file=customfield__c', customfield__c ,20,20).

But the image is not getting displayed.But if i replace the customfield__c with attachment id like below , the image is getting displayed. Please help where i am going wrong.

IMAGE('/servlet/servlet.FileDownload?file=00P28000000Ezg4', customfield__c ,20,20).

1 Answer 1


Because you've enclosed customfield__c inside single quotes it is being treated as a string literal in your formula.

You need to remove it from the single quotes and instead append it to your string to get the result you want.

IMAGE('/servlet/servlet.FileDownload?file=' + customfield__c, customfield__c, 20, 20)
  • Thanx Alex.. U r genious..Thanx again.... Jul 14, 2015 at 13:36

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.