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
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