database.queryLocator object doesn't pass records to the execute() method for the __kav objects
Not fixed yet. Salesforce is reviewing it.
Summary
The database.queryLocator object in batch apex class doesn't pass records to the execute() method for the __kav objects for certain filter conditions. However, when iterable form is used, it works fine.
For example, when the query [1] is used, the execute() method does process the records successfully but it doesn't with the query [2]:
[1] SELECT KnowledgeArticleId, VersionNumber FROM Article__kav WHERE
IsLatestVersion = true AND KnowledgeArticleId IN :knowledgeArticleIds AND
PublishStatus = 'Archived'
[2] SELECT KnowledgeArticleId, VersionNumber FROM Article__kav WHERE
IsLatestVersion = false AND KnowledgeArticleId IN :knowledgeArticleIds AND
PublishStatus = 'Archived'
This reinterpretation of the query is due to the way that KnowledgeArticleVersion works internally. We are considering to document more details on this entity specific behavior in our documentation.
For example, when the query [1] is used, the execute() method does process the records successfully but it doesn't with the query [2]:
[1] SELECT KnowledgeArticleId, VersionNumber FROM Article__kav WHERE
IsLatestVersion = true AND KnowledgeArticleId IN :knowledgeArticleIds AND
PublishStatus = 'Archived'
[2] SELECT KnowledgeArticleId, VersionNumber FROM Article__kav WHERE
IsLatestVersion = false AND KnowledgeArticleId IN :knowledgeArticleIds AND
PublishStatus = 'Archived'
This reinterpretation of the query is due to the way that KnowledgeArticleVersion works internally. We are considering to document more details on this entity specific behavior in our documentation.
Workaround
We haven't loaded the full details for this issue yet. Check the official page.
History
First tracked here as In Review with 2 reports
Nov 30, 2026
Also open in Compute Services
Static resources, documents, attachments failed to load or return 404 Not Found
Solution ScheduledPlatform / Compute ServicesSpring '20Reported Apr 24, 2020210 reports210reports
Salesforce Lightning Inspector add-on does not work when enhanced domains are enabled.
Solution ScheduledPlatform / Compute ServicesSummer '22Reported Aug 10, 202279 reports79reports
JSON.serialize Exception on Messaging.SendEmailResult Object Due to Ignoring Bean Info
In ReviewPlatform / Compute ServicesWinter '20Reported Dec 3, 201943 reports43reports
System.enqueuejob is consuming high CPU when called inside a Apex Trigger
In ReviewPlatform / Compute ServicesWinter '20Reported Nov 19, 201929 reports29reports