Tag
Apex
17 articles
How I Use Claude Code to Write Apex 5x Faster
The actual workflow I run for AI-assisted Apex development — what AI handles well, what it gets wrong, and the prompts that survive code review.
AI-Assisted Salesforce Data Migration: A Real Walkthrough
How I actually use AI across a Salesforce data migration — profiling, field mapping, and the transform Apex — plus the near-miss that set my one hard rule.
AI-Generated SOQL: Surprisingly Good, Occasionally Dangerous
AI writes cleaner SOQL than I do at 5pm — right relationships, right field names. But it can't see your data volumes. Here's where it helps and hurts.
Using AI to Generate Apex Test Classes: What Works and What Doesn't
AI can hit Apex code coverage in seconds, but coverage was never the point. Here is what AI test generation gets right, where it fails, and how I use it.
SOQL Patterns That Won't Kill Your Governor Limits
The SOQL antipatterns I keep finding in code review, the patterns that replace them, and the trade-offs nobody explains — from years of production Salesforce.
AI Code Review for Apex: My Workflow
How I run AI code review on Apex pull requests: the pipeline, the prompt rubric that cuts the noise, and the bulkification bugs two tired humans skim past.
Async Apex Patterns: Queueable vs Batch vs Future — The Decision Tree
Choosing between Queueable, Batch Apex, and Future methods is the asynchronous decision most Salesforce devs get wrong. Here's the framework I use, and the cases where the obvious choice is wrong.
REST API Integration Patterns for Salesforce
The REST integration patterns I actually use in production Salesforce orgs: named credentials, async callouts, idempotency, and when to skip REST entirely.
Apex Test Patterns: How to Write Tests That Actually Catch Bugs
Most Apex tests pass coverage and catch nothing. The patterns that actually catch bugs — test data factories, behaviour assertions, governor limit checks, and the bulk cases everyone skips.
Dynamic SOQL Done Safely
Dynamic SOQL fails more AppExchange security reviews than almost anything. Here's how I build queries that can't be injected — binds, allowlists, user mode.
CRUD/FLS Enforcement: Why Most Apex Code Fails Security Review
The CRUD and FLS enforcement patterns that actually pass AppExchange security review — and the antipatterns the scanner keeps flagging.
Error Handling in Apex: Beyond Try-Catch
Try-catch is where Apex error handling starts, not where it ends. Custom exceptions, persisted logs, partial-success DML, and errors that survive a rollback.
Sharing Rules vs Manual Sharing vs Apex Sharing: When to Use What
Sharing rules, manual sharing, or Apex managed sharing? After years spent untangling Salesforce security models, here's how I decide which one to reach for.
A Trigger Framework That Actually Scales
Most Salesforce orgs start with a handful of triggers and end up with a mess. Here's the framework I've used across government, financial services, and ISV orgs — and why the boring parts matter most.
Record-Triggered Flows vs Apex Triggers: The Decision Framework
Record-triggered flows or Apex? I've built both in production for years. Here's the exact framework I use to decide, and where each one quietly falls apart.
Custom Metadata Types: The Swiss Army Knife You're Underusing
Most admins use custom metadata for one lookup table and stop. Here's how I use it to kill hardcoded config, dodge governor limits, and keep rules in source.
Domain Layer Patterns in Apex That Survive Real Projects
The domain layer patterns I actually use in production Apex — how fflib domain classes plug into triggers, where validation belongs, and when it's overkill.