Skip to main content
New tool CRON Expression Builder — preview next run times before you schedule Apex. Open the builder →

Apex articles

Page 2 of 9 · 107 articles

A complex 3D circuit board illustrating an Apex trigger test class data flow issue.Apex

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...

· 8 min read
Apex: The Complete Guide to Salesforce's Programming LanguageApex

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,...

· 6 min read
SOQL: The Complete Guide to Salesforce Object Query LanguageApex

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,...

· 6 min read
Apex String Class: 30 Methods Salesforce Developers Use DailyApex

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...

· 5 min read
Types of Apex Triggers in Salesforce: Before, After & 7 Trigger EventsApex

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...

· 5 min read
SOQL CONTAINS vs LIKE vs INCLUDES: When to Use Each OperatorApex

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...

· 4 min read
SOQL NOT IN, NOT EQUAL & NOT LIKE: Exclusion Patterns ExplainedApex

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...

· 5 min read
SOQL ORDER BY: Sort, NULLS FIRST/LAST & Multi-Column ExamplesApex

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...

· 5 min read
3D magnifying glass inspecting a glowing formula on a circuit board, illustrating formula fields in SOQL WHERE clauses.Apex

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...

· 8 min read
A 3D puzzle piece with a lock icon representing PR validation performance and metadata security.Apex

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...

· 4 min read
A 3D glass cube representing data nodes for optimizing stateful batch apex performanceApex

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...

· 4 min read
A 3D architectural block structure illustrating the concept of calling Apex methods to create records in loops.Apex

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...

· 4 min read