anyone know how to Create a field to save the 'FullPhotoURL' of a user?
or display a user profile pic on a custom object
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Create a field on the custom object of type URL, e.g.
Retrieve the FullPhotoURL of the user (in this example, the current user):
User currentUser = [SELECT FullPhotoUrl FROM user WHERE Id = :UserInfo.getUserId() LIMIT 1];
Save a custom object record with the user's FullPhotoUrl:
MyObject__c myObject = new MyObject__c(); myObject.UserPhotoUrl__c = currentUser.FullPhotoUrl; insert myObject;