0

UPDATE

This can reproduced in any org, so it may be designed behavior or a bug. Basically, if a user is not the owner of a ContentVersion record they will only be able to filter by Id or ContentDocumentId. If they filter on any other field no results will be returned.

1 Answer 1

3

This is covered in the ContentVersion documentation as by design:

Note: Depending on how files are shared, queries on ContentDocument and ContentVersion without specifying an ID won't return all files a user has access to. For example, if a user only has access to a file because they have access to a record that the file is shared with, the file won't be returned in a query such as "SELECT Id FROM ContentDocument."

Your previous edit on your question mentioned the ShareType was I, through a record the file is shared with, which is specifically mentioned in the quoted documentation above.

You can also see the following answer that goes over this accessibility of content versions in queries as well.

1
  • Thanks. For my scenario, I will need to query first by the linked entity Ids and then use the content document Ids to query for the content versions. Users are also able to query by the ContentDocumentId (as well as the Id).
    – Andrew L.
    Jan 1, 2022 at 15:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .