Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many query rows exception #29

Closed
marcin-zabadaj opened this issue Apr 21, 2022 · 2 comments
Closed

Too many query rows exception #29

marcin-zabadaj opened this issue Apr 21, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@marcin-zabadaj
Copy link

Describe the bug
When I edit Action Plan, add a new Task, and save, the "LabsActionPlans: Too many query rows: 50001" exception is thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Action Plan record
  2. Click Edit
  3. Add new Task and populate the required field
  4. Click Save
  5. See error

Expected behavior
Action Plan should be saved without any errors.

Screenshots
image

Log File
log.txt

Additional Info
I think the exception is thrown in ActionPlansBuilderUtilities class in the line 190: for (Task tmpTask : [SELECT Id, TaskAPTask__c, Subject FROM Task WHERE TaskAPTask__c IN :mapAP.keySet()]) {. When mapAP contains null as a key, the number of Tasks returned by query exceeds 50000, and the exception is thrown. You should update the WHERE part of your query to exclude Tasks with empty TaskAPTask__c field.

@marcin-zabadaj marcin-zabadaj added the bug Something isn't working label Apr 21, 2022
@dschach dschach self-assigned this Apr 21, 2022
@dschach
Copy link
Contributor

dschach commented Apr 21, 2022

Thank you, @marcin-zabadaj - this will be updated in the next released version. We will change that map to a set that is populated after the upsert, so we are sure that only populated records are queried... but will still specify the value is not null, just in case. This is being done in branch release/4.2.0.

@dschach dschach mentioned this issue Apr 25, 2022
@dschach
Copy link
Contributor

dschach commented Apr 27, 2022

Please install 4.2.0 once it is live on Appexchange today/tomorrow and give feedback. Thank you!

@dschach dschach closed this as completed Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants