+ Start a Discussion
Atif MohammedAtif Mohammed 

How do i insert an different image through formula...

How do i insert an different image through formula field from documents to an product object


If i go with this 


IMAGE("/servlet/servlet.FileDownload?file=015i00000001hVq", "Laptop" , 100, 100)


The same image come up for all the products.


The another way which i have tried is by creating an field like imageid on the product object like and created the formula


IMAGE("/servlet/servlet.FileDownload?file=" & Product_ImageId__c , 
Name,50,50 )


But the above problem is that i need to manually code the id and paste it in the field of imageid soo that the above formula works out.


Is there any other way to fetch the document id by matching the product name and the document name which displays the image.



Thanks in advance who guides me out.






The association of a document with a product would be essentially a manual task. Someone has to use an available image (create and upload it as a document if none available for the product). You could probably provide a VisualForce page to display a list of products and a list of documents that are images so that someone can make the association manually through the UI. You would then store the id of the document selected in Product_ImageId__c for that product. If you come up with some naming conventions for your product images, you may be able to make this a little bit more efficient. So if someone selected a product named Bolts, may be you bring back documents of type image that have "Bolts" in their name.