Course 2.2 · Curriculum 2026.1
Triggers, handlers and bulk safety
One trigger per object, all logic in a handler, and recursion controlled on purpose. The pattern that keeps an org maintainable at year five.
- Estimated effort
- 6 hr
- Lessons
- 47
- Modules
- 8
- Material
- 6 hr
Estimated effort is the sum of the lesson and lab times in this version of the course. It is not video runtime, which is lower.
Canadian dollars. One learner, lifetime access to this course version. Tax extra.
1 lesson free to preview
This course does not issue a certificate on its own. It counts toward the paths listed below, and those do.
01What you will learn
8 capabilities, stated as things you can do
Each one is what you should be able to do at the end, not what the course covers. If an outcome is not testable, it is not an outcome.
- Write one trigger per object that delegates every decision to a handler class.
- Choose the right trigger context, and say why before-insert beats after-insert for a field update.
- Control recursion deliberately with a static guard rather than by hoping.
- Order automation across triggers, flows and validation rules, and predict the save order.
- Bulkify a handler so 200 records cost the same queries as one.
- Handle partial failure so one bad record does not roll back an entire load.
- Diagnose a trigger that fires twice, and explain why it did.
- Decide when logic belongs in a trigger, a flow, or neither.
02Curriculum
8 modules, 47 lessons
Every lesson shows its length and its type. A SCORM lesson looks like any other lesson, which is the point of ingesting packages rather than linking out to them.
8 modules · 47 lessons · 6 hr of material
Nineteen steps run between a user clicking save and the record existing. Knowing the order explains almost every "why did that happen" ticket.
- VideoThe order of execution, walked step by stepPreview9 min
- VideoTrigger contexts, and choosing before over after8 min
- VideoWhere flows, validation rules and triggers interleave8 min
- VideoRollup summaries and cross-object formulas in the order6 min
- ReadingReading: the order of execution, as a reference page5 min
- VideoThe trigger.old and trigger.new maps at each stage5 min
- LabLab: predict then verify the save order in your own org14 min
The rule stated first because it is the one that stops a second developer from ever writing a second trigger on the same object.
- VideoOne trigger per object, and why two is a race condition8 min
- VideoNaming and locating the one trigger so nobody adds a second6 min
- VideoVendor-managed triggers, and why they stay out of source control7 min
- VideoConfirming a trigger is the only one on an object before deploying5 min
- LabLab: find every trigger on one object in a real org11 min
All logic in a testable class, none of it in the trigger body. This is the single decision that keeps a codebase reviewable.
- VideoA handler class you can unit test without DML8 min
- VideoDispatching by trigger context to one method per event6 min
- ReadingTrigger frameworks: what they buy and what they cost6 min
- VideoDependency injection so a handler is testable in isolation6 min
- VideoSplitting a handler method per trigger context cleanly5 min
- LabLab: refactor a 300-line trigger into a handler14 min
A trigger that re-fires itself is not a bug in the platform. It is a static variable that was never reset, or never set.
- VideoRecursion guards, and the static that is not reset8 min
- VideoThe trigger that fires twice, diagnosed7 min
- VideoWhen recursion is correct, and guarding it anyway6 min
- VideoA static guard reset between test methods, and the bug that hides5 min
- LabLab: cause a recursive update, then guard against it12 min
A trigger that works on one record and fails on two hundred is the most common defect in a Salesforce codebase. This module removes it.
- VideoTrigger.new, Trigger.oldMap, and the maps you should build once8 min
- VideoBulkifying a handler so two hundred records cost the same queries as one7 min
- VideoThe query-in-a-loop defect, found in review6 min
- ReadingReading: a bulk-safety checklist for a trigger review5 min
- ReadingReading: the addError message a user actually sees4 min
- LabLab: break a handler with a bulk load, then fix it13 min
allOrNone false, and the rule that an order must never fail to save because a follow-up task could not be created.
- VideoaddError, partial success, and not rolling back the whole load8 min
- VideoAn order must never fail to save because a follow-up task could not be created8 min
- VideoDatabase.insert with allOrNone false, and reading the results back7 min
- VideoLogging a partial failure so it is diagnosable later6 min
- VideoChoosing which DML method surfaces which kind of error5 min
- LabLab: make a follow-up write fail without failing the parent save13 min
Roughly 191 active flows share these objects with 32 triggers. Deciding where logic lives is a daily decision, not a one-time design.
- VideoCoexisting with roughly 191 active flows on the same objects8 min
- VideoDeciding when logic belongs in a trigger, a flow, or neither7 min
- VideoA flow and a trigger both writing the same field, diagnosed7 min
- VideoA record edited by both a flow and a trigger in the same save5 min
- ReadingReading: a decision table for trigger versus flow5 min
- LabLab: trace a field update to the automation that made it12 min
A handler is only as good as the test that proves it survives two hundred records and a partial failure.
- VideoTesting a trigger with 200 records, not one8 min
- VideoTesting that a partial failure genuinely did not block the parent7 min
- ReadingCode review checklist for a new trigger handler5 min
- VideoPeer review: reading someone else’s handler for recursion risk5 min
- LabLab: bring a handler to a passing bulk and partial-failure test11 min
- QuizCheck: triggers and bulk safety15 min
03Before you start
What you need first
Assumed knowledge and setup
- Course 2.1. Bulk patterns and limits are assumed knowledge here.
- A Developer Edition org and the CLI.
- Course 1.4 helps: much of this course is about coexisting with flows.
Courses that come first
- 2.1 · Apex fundamentals, and the governor limits that shape every design8 hr · Intermediate
Part of these paths
- Salesforce DeveloperShareCo Certified Developer
- The Full StackShareCo Certified Platform Engineer
04Who teaches it
Elliot Saha
Co-founder, Chief Technology Officer
Platform architecture, custom Apex and Lightning Web Components, AI systems, and the Academy platform itself.
05Reviews
No learner reviews yet
This course has not been taken by enough people to publish an honest rating, and we will not print invented quotes on a page that sells verification discipline. Here is what we can evidence instead.
- Assessment
- Lesson checks onlyThis course carries lesson checks. The certificate is issued by the path assessment, not by this course.
- Curriculum version
- 2026.1You enrol into a version. Content changes do not move you mid-course, and your required-lesson count is snapshotted at enrollment.
- Refunds
- 14 daysFull refund within 14 days if you have completed under a quarter of the required lessons. Stated here rather than in a footer.
Start 2.2
Enrol as an individual, or buy seats and assign this course to your team. Progress is reported per lesson, per module and per path.
- 6 hr estimated effort, labs included
- Lifetime access to the version you enrol in
- A ShareCo certificate is not a Salesforce certification