You need to sign in to do that
Don't have an account?

Does SOQL query with WHERE and IN Clause has a limitation while comparing huge number of record IDs?
Hi,
I have tried to show list of related Case files(Content Documents) in a lightning component on Account page. While querying I got 12000 related case records for a account. Now I have to fetch the Content Document IDs through Content Document Link. When i run the below SOQL I am getting only few Content Document Link records but I have 11 case records which are having files. The below query results only 5. Is there a limitation on WHERE clause or ContentDocument Link while querying huge number of records?
CaseList=SELECT id FROM Case WHERE AccountId=:accID // This results 12000 case records
List<ID> caseIDs=new List<Id>();
For(Case c:CaseList)
{
caseIDs.add(c.Id);
}
SELECT LinkedEntityId,LinkedEntity.Name, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId=:caseIDs // This results only 5 records but we have 11 ContentDocuments
Thanks in advance.
I have tried to show list of related Case files(Content Documents) in a lightning component on Account page. While querying I got 12000 related case records for a account. Now I have to fetch the Content Document IDs through Content Document Link. When i run the below SOQL I am getting only few Content Document Link records but I have 11 case records which are having files. The below query results only 5. Is there a limitation on WHERE clause or ContentDocument Link while querying huge number of records?
CaseList=SELECT id FROM Case WHERE AccountId=:accID // This results 12000 case records
List<ID> caseIDs=new List<Id>();
For(Case c:CaseList)
{
caseIDs.add(c.Id);
}
SELECT LinkedEntityId,LinkedEntity.Name, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId=:caseIDs // This results only 5 records but we have 11 ContentDocuments
Thanks in advance.
I guess there are 5 records (ContentDocumentLinks) which are added on Cases whose AccountId is the one you are passing in the first query.
Can you just verify whether the other ContentDocuments which are not appearing (6 out of 11) are added on Cases and those Cases' Account Id is the same as the one you are passing?