+ Start a Discussion
Simon234Simon234 

1 level deep in a SOQL query

I can't choose my last file by record Id (this file was uploaded for this record). How can I do that by SOQL query?
conVersion = [SELECT Id FROM ContentVersion WHERE (Select LinkedEntityId from ContentDocumentId_r =: recId) order by CreatedDate DESC limit 1];

 
Raj VakatiRaj Vakati
Try this 
 
select Id, Title ,ContentSize, FileType, VersionData, PathOnClient from ContentVersion   where   ContentDocumentId =: recId order by CreatedDate DESC limit 1