Salesforce Decode
Salesforcedecode
SOQL & Data ModelingIntermediateTroubleshootingtroubleshootinggovernor-limitssoql

How do you handle "Too many query rows: 50001"?

Scenario

A trigger that recalculates a total queries all Opportunities of an Account; big Accounts have 80,000.

Answer it out loud first

Serious prep means attempting before reading. Take two minutes to structure your answer, then compare.