AnsweredAssumed Answered

How to display dynamic pictures in CRM for different contacts that has sugarfield type as image?

Question asked by Talha Anwar on Jan 2, 2017
Latest reply on Jan 3, 2017 by sugar.dennis

I don't want to store these pictures but fetch them dynamically from URL. eg: for user 1 I would fetch user1.png (based on some logic). Now, the photo field is of type image (sugarfield type).


I tried using PHP in .tpl to add my dynamic logic but it didn't work out. So I used logic hook (after_retrieve and process_record).


In logic hook I did the following:


  $bean->photo='<img src="url.png" />


but it did not work out in either logic hooks. Is it happening because of sugarfield image. If yes, how to override it or how to do what I want to do.


TL;DR Fetch image from a url (different url based on logic) and display it in a contact field whose type is image (sugarfield->image)