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
Ravi RoyRavi Roy 

SOQL where filter on custom field of ContentVersion doesn't return record

If the reocrd is not share with user then when queried using filter on custom field it doesn't return record. But when queried using Id filter or contentdocumentId filter then it return the record.
I have a custom external Id field Unique_Key_String__c' which I'm using in query
Below query doesn't work
Select id,Unique_Key_String__c,Origin,PublishStatus,SharingOption,SharingPrivacy from contentversion where Unique_Key_String__c= '0683C000000K9Mr;cv'
Below query works
Select id,Unique_Key_String__c,Origin,PublishStatus,SharingOption,SharingPrivacy from contentversion where id = '0683C000000K9Mr'

this happens only when record is not shared with current user
c_jonasc_jonas

I can confirm this as well.. Not sure how long it's been this way, but it's super messed up.

I found that if I query through the ContentDocumentLink, it will return correctly for more filters (like != null) but still not everything (like filtering on a specific string)

 

Documented here: https://twitter.com/NimbusNinja/status/1310096094261465089