Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Avoid using SOQL subqueries for query locator error#8

Open
ninoish wants to merge 11 commits into
masterfrom
kn/avoid-subquery
Open

Avoid using SOQL subqueries for query locator error#8
ninoish wants to merge 11 commits into
masterfrom
kn/avoid-subquery

Conversation

@ninoish
Copy link
Copy Markdown
Collaborator

@ninoish ninoish commented May 27, 2021

Record Clone has been using SOQL subqueries to fetch child relationship records so to simplify and minimize the SOQL executions. However when child records are too many , it causes Aggregate Query Error and Invalid Query Locator Error when trying to access the child data bypassing its parent data. In additions to the number of records, it has been reported that there are some odd cases causing the same error with small number of child records, which is not documented in any help page.
Taking the situations into account, using SOQL subqueries for obtaining child records is replaced with simple SOQLs executed for each sobject. It increases the number of SOQL executions, but it follows the rules of governor limits that makes it observable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant