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)