field 'recordname' is not marked queryableSalesforce error when SOQL or the Tooling API selects a field whose IsQueryable metadata flag is false. Three causes — history tables, Tooling API metadata objects, and dynamic SOQL — with the fix for each.
UserInfo.getDefaultCurrency()What UserInfo.getDefaultCurrency() actually returns in Apex, the difference between single-currency and multi-currency orgs, and how to read the corporate currency safely in both.
Method does not exist or incorrect signatureThe eight things that produce this Apex compile error — typos, generic erasure, hidden statics, missing namespace prefixes, and more — with the diagnostic question and the fix for each.
System.NullPointerException: Attempt to de-reference a null objectThe most common Apex runtime error: unchecked Map.get() misses, null field reads through relationship paths, uninitialized collections — where it actually comes from and the guard patterns that end it.
UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this recordRecord lock contention: parallel tests, batch jobs colliding on parent records, and integrations updating the same account hierarchy — how the lock works, how to order DML to avoid it, and what a retry should actually retry.
MIXED_DML_OPERATION: DML operation on setup object is not permittedWhy User, Group, and PermissionSet can't share a transaction with data objects, and the two legitimate fixes — System.runAs in tests and @future separation in production code.
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITYThe wrapper, not the error: how to read the nested exception a trigger or flow actually threw, and how to get at the real cause instead of debugging the envelope.
REQUIRED_FIELD_MISSING: Required fields are missingSchema-required fields, universally required custom fields, and master-detail lookups — plus the insert/update asymmetry that makes the same record pass one DML and fail the other.
System.QueryException: List has no rows for assignment to SObjectA single-SObject SOQL assignment returned zero rows. In tests it's almost always missing @testSetup data or data visibility; in production it's an unguarded query. Both fixes, with the pattern that avoids it entirely.
INVALID_CROSS_REFERENCE_KEY: invalid cross reference idAn Id pointing at the wrong object, a deleted record, or another org — hardcoded test Ids and copy-pasted lookups are the usual suspects. What the key prefix tells you and how to trace the bad reference.
FIELD_CUSTOM_VALIDATION_EXCEPTIONA validation rule fired — often on test data a factory didn't satisfy. How to find which rule, when bypass flags are legitimate, and how to build test data that passes the rules on purpose.
DUPLICATE_VALUE: duplicate value foundUnique-field collisions across tests and within bulk inserts, versus duplicate rules — two different mechanisms behind one error code, each with its own fix.
Future method cannot be called from a future or batch methodThe async-from-async rule: why @future can't call @future, how batch context triggers it, and the Queueable pattern that replaces the workaround zoo.