EcumenicalHungerProgram / FoodBank

A Salesforce application suitable for running a food bank
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Triggers fail with too many records #52

Closed cmumford closed 10 years ago

cmumford commented 10 years ago

I was able to load up 58,000 services, but when deleting them I got this error:

Validation Errors While Saving Record(s)

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger updateTimeSlots caused an unexpected exception, contact your administrator: updateTimeSlots: System.LimitException: Too many query rows: 50001".

Click here to return to the previous page.

cmumford commented 10 years ago

Reopening: still hitting this limit.

Service_results.csv:75150000003h2OhAAI,43064,,false,false,CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:updateTimeSlots: System.LimitException: Too many query rows: 50001:--
rmsu commented 10 years ago

Can I steal this one? I want to play around with the triggers logic.

cmumford commented 10 years ago

Absolutely.

rmsu commented 10 years ago

I think the problem is that sometimes null values are sneaking into the set of changed timeslot IDs, which causes a giant result set of all services with null timeslot. I've changed it in the cmumford sandbox, can you try it out with the large data set?

cmumford commented 10 years ago

Yes, hour change (cb293d6) works and am no longer hitting this limit. :+1: