Skip to content
Bug Barometer
All issues
Solution Deployed

Uncategorized

SOQL on ContentVersion not returning all matching rows in trigger context with API version > 31

Summary

In API version >31,

If an SOQL is run on ContentVersion within a trigger on ContentDocument using context variable:
For example: where ContentDocumentId in:trigger.oldMap.keyset()

and then a Nested SOQL is run on ContentVersion, the nested SOQL does not return all rows.
Nested SOQL returns just the record which is queried before using context variable.

Workaround

We haven't loaded the full details for this issue yet. Check the official page.

History

  1. First tracked here as Solution Deployed with 1 report

    Nov 30, 2026

SOQL on ContentVersion not returning all matching rows in trigger context with API version > 31 · Bug Barometer