Salesforce limits the maximum number of rows that a SOQL query can return to 50,000 records. When this number is exceeded, a runtime exception is thrown. As a best practice, developers should always use either a WHERE or a LIMIT clause to cap the maximum number of results.
Business Impact
Increased system downtime and inaccessibility, leading to decreased customer satisfaction and operational inefficiency.
Is your Salesforce solution affected by Unbound SOQL statement?
Clayton detects anti-patterns and offers automated fix advice to kickstart your Well-Architected journey.