function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
thanushka_gunasekarathanushka_gunasekara 

Get the Chatter profile image to a custom Object

How to get the Chatter Profile image to a Custom object's field and display it to each correspoding record of custom object?

 

Thanks in advance.

*werewolf**werewolf*

As of Spring '11 you will be able to get to the images via the SmallPhotoUrl and FullPhotoUrl fields on User.

thanushka_gunasekarathanushka_gunasekara

Hi,

 

Thanks for replying. Can you expalin your answer. I've looked in both User Object and Custom Objects, but nuable to find the SmallPhotoUrl and FullPhotoUrl fields.

 

And also would be grateful if you can expalin how to use them.

 

Thansk in advance.

ChamingaDChamingaD

Visualforce Page


<apex:image id="profileImage" url="{!profileImageUrl}" />

 

Custom Controller

 

public string profileImageUrl    { get; set; }
    
profileImageUrl = [select FullPhotoUrl from User where Id = '1234'];

*werewolf**werewolf*

As I mentioned, this is in Spring '11.  Spring '11 will not begin to be released to production until the end of this week.

*werewolf**werewolf*

Oops, no, I am mistaken, those fields are in fact available now.  You can access them as the other poster gave examples of.