+ Start a Discussion

Pulling images for Attachment Owner Records



I want to to extract Attachment Owner 'Photo' along with 'body' of the Attachment. Can anyone suggest SOQL to fetch the 'photo'?


I am trying this SOQL, but goving error like No such column:


Query from Attachment:

Select a.Body, a.Owner.FullPhotoUrl From Attachment a


ERROR at Row:1:Column:16

No such column 'FullPhotoUrl' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.


Query from USER:

Select FullPhotoUrl from User --> is working fine w/out error.


Any suggestions would be appreciated..



Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi Srinu,


Are you getting this field value directly from user(Owner) record?

Is 'FullPhotoUrl' is a custom field in your user record?
If it is so, then you need to mention it with FullPhotoUrl__c

Your query is right, but should give the proper field API names. Try the following query,
Select a.Body, a.Owner.FullPhotoUrl__c From Attachment a

Hope this will help you..!


Please, don't forget to give Kudos and mark this answer as a Solution if this works out.


Hi Kamatchi Devi R,


Is 'FullPhotoUrl' is a custom field in your user record?


No, its not a custom field. It's a standard field on USER table.



I tried your query, same error.


As you know, I am trying to acces that field from Attachment table and getting into error.

Dhaval PanchalDhaval Panchal
FullPhotoUrl is not a custom field, its a standard field. This issue is really strange.

select id, ownerId, createdbyid, Owner.FullPhotoUrl from Contact
select id, ownerId, createdbyid, Owner.FullPhotoUrl from Account

both queries are working but below query is not working

select id, ownerId, createdbyid, Owner.FullPhotoUrl from Attachment

even query on note is also working fine

select id, ownerId, createdbyid, Owner.FullPhotoUrl from Note.

Hi Dhaval Panchal,


I am extracting data from Attachment, ContentVersion and Document tables. As well as owner/Author photos.


I can successfully execute queries on Content & Document. 

Select d.Author.FullPhotoUrl, d.AuthorId From Document d
Select c.Owner.FullPhotoUrl, c.OwnerId From ContentVersion c


Why i can't execute same manner of query from Attachment table? is there any reason behind it like system security or sth like that.....?


Select a.Owner.FullPhotoUrl, a.OwnerId From Attachment a


any suggestions would be appreciated.