Find clear explanations, root causes, and tested solutions for every common Salesforce error.
Aggregate queries don't support pagination with queryMore(). Use LIMIT and OFFSET instead.
Aggregate queries with for-loops exceed 2,000 row limits. Use LIMIT and OFFSET pagination.
Synchronous limit is 10,000ms, async is 60,000ms. Optimize loops, queries, and logic.
Synchronous heap limit is 6MB, async is 12MB. Reduce collections and use transient variables.
Production deployments require 75% overall test coverage. Improve your test classes.
A validation rule is blocking the DML operation. Debug field values against validation criteria.
Cannot use relationship traversal on a non-relationship field in your SOQL query.
Permission, sharing, or ownership issues preventing record creation or updates.
Cross joins are not permitted in SOQL. Use supported relationship traversal patterns.
Date values must be formatted as YYYY-MM-DD in SOQL queries.
The SOQL operator used is not valid for this field type. Check operator compatibility.
The replication date value is invalid. Ensure date format and value are correct.
Referenced SObject type doesn't exist in your org. Check the spelling and API names.
Accessed a list element without checking if it contains data. Always verify list size.
Attempted to access a list index that doesn't exist. Verify index is within range.
SOQL syntax error detected. Check brackets, quotes, commas, and reserved keywords.
Cannot divide by zero. Always check divisor values before arithmetic operations.
Cannot combine MAX or MIN aggregate functions with rollup fields. Use separate queries.
Recursive trigger firing exceeds 16-depth limit. Implement recursion guards or batch processes.
Field doesn't exist on the SObject. Verify field API name spelling and permissions.
Query returns too many rows without selective filters. Add indexed field conditions.
Query lacks selective filters or indexed fields. Add WHERE conditions on indexed fields.
Attempted operation on a null object reference. Always validate objects exist before access.
Bind variables must be referenced variables only. Cannot use expressions or method calls.
Query execution exceeded time limit. Optimize with filters, indexes, or pagination.
API request count exceeds org limits. Implement request throttling and batching strategies.
Semijoins using IN with subqueries are only allowed in WHERE clauses, not SELECT.
Field wasn't included in the query. Add it to SELECT clause before accessing.
Query lacks filters on indexed fields. Add WHERE conditions to improve performance.
Aggregate query limit exceeded. Combine aggregate queries or use Batch Apex.
Exceeded 100 callout limit per transaction. Batch requests or use asynchronous processing.
Exceeded the 150 DML statement limit. Consolidate operations using lists and single calls.
Exceeded 50 @future method calls per transaction. Use Batch Apex or Queueable instead.
Query returned more than 50,000 rows. Add filters or use LIMIT to paginate results.
Batch job query returns more than 50,000,000 rows. Add filters or process in smaller batches.
Exceeded 50 Queueable job enqueues per transaction. Use chaining sparingly.
Exceeded the 100 SOQL query limit per transaction. Learn bulkification patterns to fix this.
Row-level locking contention when multiple operations target the same record simultaneously.
SOQL query is incomplete. Check for missing clauses, brackets, or punctuation.
Setup and non-setup sObjects cannot be modified in the same transaction. Separate operations using @future or Queueable.
A duplicate rule or unique field constraint is blocking the insert or update. Review duplicate rules and unique field configuration.
The record you are trying to access has been deleted. Check for soft-deleted records or race conditions in your logic.
A required field was not populated before a DML operation. Ensure all mandatory fields are set on the sObject before insert or update.
A field value exceeds its maximum allowed character length. Truncate the string or increase the field length in Object Manager.
A trigger, workflow, or process automation is throwing an unhandled exception and blocking the DML. Inspect the referenced entity's automation.
View state exceeds the 170 KB limit. Mark variables as transient, reduce collection sizes, and move heavy logic server-side.
Exceeded the 10 sendEmail() call limit per transaction. Consolidate email sends into a single Messaging.sendEmail() call with a list.
A trigger attempts to update the same record that fired it, creating a recursive loop. Use a static Boolean flag to prevent re-entry.
The session token has expired or is malformed. Re-authenticate your integration or refresh the OAuth access token before retrying.
The referenced Record Type does not exist or is inaccessible to the running user's profile. Verify Record Type assignment and profile permissions.
The Apex Flex Queue holds a maximum of 100 batch jobs. Monitor and stagger job submissions using Database.getAsyncApexJobId.
A read-only or non-creatable field was included in an insert or update. Remove formula fields, auto-number fields, and system fields from your DML.
The relationship traversal used in the SOQL query is not supported for this object pairing. Restructure using a separate query and a Map.
One or more metadata components failed validation during deployment. Review the component errors in the deployment detail page and fix each individually.