+ Start a Discussion
JamieTJamieT 

Referencing Documents with the Image function???

Hi There,

I have a bank of images that I will be uploading to Documents in sfdc. I will then be creating a Image formula field in a Custom object, where I would like to source the correct Image based upon certain parameters. These will more than likely be based on infor captured in 2 Text fields.

Is there any way to do this without having to specify the unique URL for each seperate Image/Document in the custom formula field? Could you reference the correct image based upon the name of the Document and a keyword or similar?

Any help will be much appreciated!

Thanks

J
FreshFresh

JamieT wrote:
Hi There,

I have a bank of images that I will be uploading to Documents in sfdc. I will then be creating a Image formula field in a Custom object, where I would like to source the correct Image based upon certain parameters. These will more than likely be based on infor captured in 2 Text fields.

Is there any way to do this without having to specify the unique URL for each seperate Image/Document in the custom formula field? Could you reference the correct image based upon the name of the Document and a keyword or similar?

Any help will be much appreciated!

Thanks

J




Hi Jamie,

You will have to individually reference the URL's, but you can have it change based on the text fields. You are going to need to run a series of IF statements within your image, so it will look something like this...

IMAGE(IF(AND(Statement 1, Statement 2), "/servlet/servlet.FileDownload?file={Image 1}", IF(AND(Statement 3, Statement 4), "/servlet/servlet.FileDownload?file={Image 2}", "/servlet/servlet.FileDownload?file={Image 3}")), "Image Name")

Good Luck!
JamieTJamieT
Thanks for that. This is what I expected I would have to do. The main problme I forsee is with the limitation on the number of characters for the custom formula - becasue of the number of images I don't think this will work.

Although I believe this is due to be increased in winter '09?


FreshFresh
If you are looking to save characters, you could have one formula field that comes up with a number that corresponds with the images (this would not be on the page layout), have a workflow copy that number to a read only number field that is also not on the page layout, and have the image formula read off of the number field. This will allow you to essentially double the number of characters you have to work with by splitting up the operation.

Good luck!