sfhero · Salesforce Apex

Learn Apex

Pick a topic — each opens on its own page with interactive examples and short, practical code you can read like a teammate left you notes.

Access modifiers
private through global — short rules, full class examples, and a live “who can see” grid.
Open lesson
Collections
List, Set, Map — read Apex-shaped snippets, then play with the sandbox.
Open lesson
SOQL basics
Build a SELECT … FROM … WHERE … LIMIT query — watch the string and the binding pattern.
Open lesson
Trigger context
Insert, update, delete — see which Trigger.new / old / maps exist for each event.
Open lesson
Exceptions & nulls
Walk try/catch/finally paths and compare null checks vs String.isBlank for real data.
Open lesson
Sharing in Apex
with / without / inherited sharing — mini org simulator, live class shape, scenario cards.
Open lesson
Permission sets
Stack profiles + sets on a toy user — see CRUD merge, field-level badges, myth cards.
Open lesson
Apex best practices
Governor toy bars, SOQL/DML flip code, tap-the-safe-snippet quiz, habit checklist.
Open lesson
Sharing rules
OWD + peer rule on/off — see when Bob can see Alice’s Account (toy model).
Open lesson
OWD
Organization-wide defaults — Private vs Public Read vs Read/Write baselines.
Open lesson
Apex managed sharing
Toggle a simulated AccountShare — see Apex creating share rows in code.
Open lesson
Order of execution
Step through triggers, validation, automation — simplified pipeline.
Open lesson
Variables & data types
Integer, Decimal, String, Boolean, Id, Date — tap each for notes and snippets.
Open lesson
DML operations
insert / update / delete / upsert / undelete — flip examples, match op to story.
Open lesson
Bulkification
Slider batch size, naive vs bulkified — watch SOQL/DML counts move.
Open lesson
Governor limits
Toy pressure dial filling SOQL / DML / CPU / heap bars — mitigations list.
Open lesson
Static vs instance
Tap to increment — instance vs static counters side by side.
Open lesson
Constructors
Overload picks — which new Service(...) maps to which constructor.
Open lesson
Polymorphism
Dog / Cat / Bird — runtime type picks speak(); virtual/override snippet.
Open lesson
Context variables
isInsert, isUpdate, isBefore, size, operationType — tap event; table updates live.
Open lesson
Trigger.new vs Trigger.old
Sliders for old vs new Amount — “changed?” panel flips when they differ.
Open lesson
Recursion prevention
Toggle static guard — simulate save; counter explodes or stays controlled.
Open lesson
Trigger order of execution
Shuffle trigger names — reveal alphabetical run order (same object).
Open lesson
Future methods
Sync vs @future box — fire async (toy) and see the separate transaction idea.
Open lesson
Queueable Apex
enqueueJob — queued → done animation; minimal Queueable snippet.
Open lesson
Batch Apex
Slide total rows + batch size — watch execute() count update.
Open lesson
Scheduled Apex
Presets (hourly / daily / weekly) — cron string and plain English.
Open lesson
Chaining Queueables
Next step — Job A/B lights up as you walk the chain (toy).
Open lesson