Apex articles
Page 2 of 9 · 107 articles
Apex Trigger Not Updating: Test Class Field Value
Your trigger looks like it is ignoring the field values your test class sets. Usually it is stale in-memory data, a...
Apex: The Complete Guide to Salesforce's Programming Language
Apex is Salesforce's strongly-typed, server-side language. This pillar covers data types, triggers, async patterns,...
SOQL: The Complete Guide to Salesforce Object Query Language
SOQL is the SQL-flavored query language Salesforce ships for reading data. This pillar page covers every operator,...
Apex String Class: 30 Methods Salesforce Developers Use Daily
Every Apex String method that matters in real code: split, join, contains, trim, escape, format, and the ones that...
Types of Apex Triggers in Salesforce: Before, After & 7 Trigger Events
Apex triggers come in two timing variants (before and after) and seven event types. Knowing which to use prevents...
SOQL CONTAINS vs LIKE vs INCLUDES: When to Use Each Operator
SOQL has no CONTAINS keyword. Most queries reaching for one want LIKE with wildcards, or INCLUDES for a multi-select...
SOQL NOT IN, NOT EQUAL & NOT LIKE: Exclusion Patterns Explained
Three ways to exclude records in SOQL: NOT IN with subqueries, != / <> for direct comparison, and NOT LIKE for pattern...
SOQL ORDER BY: Sort, NULLS FIRST/LAST & Multi-Column Examples
Every SOQL ORDER BY pattern in one place, from ASC/DESC and multi-column priority to NULLS FIRST vs NULLS LAST, sorting...
Formula Field in SOQL WHERE Clause: Best Practices
Filtering a SOQL WHERE clause on a formula field works, but the value is calculated per record and can never be...
PR Validation 10x Slower: Solving Permission Set Bottlenecks
Why the metadata engine slows down when Permission Set changes ride along with Apex classes in a Salesforce CI/CD...
Stateful Batch Apex: Should You Cache Picklist Values?
Holding metadata like picklist values in stateful variables looks like a free performance win, and it brings...
Calling Apex Methods to Create Records in Loops from LWC
Bulk record creation from a Lightning Web Component: why looping Apex calls is an anti-pattern, and what a bulkified...