Salesforce DevOps Course Module 3: Change Sets Mastery — Complete Guide 2026
Complete Guide 2026
📍 Course Progress — Module 3 of 15
Intro
Sandboxes
Change Sets
Metadata API
Git Basics
SFDX & CLI
Scratch Orgs
Packages
DevOps Center
Deploy Strategy
GitHub Actions
Advanced CI/CD
Unlocked Pkg
Enterprise
Capstone
📋 What You Will Learn in This Module
📚 Full Course Navigation
📦 Section 1 — What is a Change Set?
The foundation of Salesforce deployment — every admin and developer must know this
No CLI. No coding. No external tools. Just Salesforce Setup — which is why every admin and developer starts here.
| Type | Where Created | What It Does |
|---|---|---|
| 📤 Outbound Change Set | Source org (your sandbox) | You add components and upload to the target org |
| 📥 Inbound Change Set | Target org (production) | You receive and deploy from the source org |
You pack your items (components) into a box (Outbound Change Set), send it to the recipient address (upload to target), the recipient receives the package (Inbound Change Set), opens it, checks the contents (validate), and accepts delivery (deploy).
The courier route (deployment connection) must exist before any package can be sent.
| ✅ Can Include | ❌ Cannot Include |
|---|---|
| Apex classes and triggers | Data records (Account, Contact, etc.) |
| Lightning Web Components | Documents and attachments |
| Aura components | Deleted components |
| Flows and Process Builder | Users and their settings |
| Custom objects and fields | Dashboards and reports (must recreate) |
| Page layouts and record types | Org-wide settings (must configure manually) |
| Profiles and Permission Sets | Connected App credentials |
| Email templates | Named Credential secrets |
| Custom labels | Scheduled jobs |
🔗 Section 2 — Deployment Connections
The prerequisite for every Change Set — how to set up the trust relationship between orgs
- Production automatically connects to ALL its sandboxes — you just need to authorize
- Sandbox-to-sandbox connections must be manually enabled from both sides
- Cannot deploy FROM production TO sandbox using Change Sets — one directional
- Only works between orgs in the same Salesforce instance/environment
- Unrelated orgs (different companies) cannot establish deployment connections
Sandbox
Sandbox
Sandbox
Each arrow represents an established Deployment Connection. Changes only flow forward — never backward using Change Sets.
🛠️ Section 3 — Creating Your First Change Set
Step-by-step walkthrough — from zero to successful deployment
Good: "Visit_Report_LWC_v1" | Bad: "Changes" or "Test123"
Example: "Adds Visit Report LWC with pagination and quality rating fields"
Add by metadata type — Apex Class, LWC, Custom Field, etc.
Salesforce shows you components that your selections depend on
Missing dependencies = deployment failure
Change Set is now sent to the target org
Find your Change Set — status should be "Awaiting Deployment"
This runs all Apex tests without making changes — your safety net
If validation fails: read the error log, fix in sandbox, re-upload
All changes are now applied to the target org ✅
| Format | Example | Why |
|---|---|---|
| FeatureName_Type_Version | VisitReport_LWC_v1 | Clear what it contains |
| TicketNumber_Description | JIRA-245_OrderTriggerFix | Links to work item |
| Date_Description | 2026May_QuarterlyRelease | Easy to find by date |
❌ Never name Change Sets: "test", "changes", "temp", "urgent" — you will regret it in 6 months when you can't remember what it contained.
✅ Section 4 — Validate vs Deploy vs Quick Deploy
The most important distinction in Change Set deployments — understanding each option
When to use: Always before any production deployment. Use during business hours so test results are ready by your deployment window.
Output: Success (tests pass, ready for deploy) or Failure (error log shows exactly what broke)
Time: Same as a real deployment — can take 20-60 minutes depending on test suite size
Bonus: A successful validation is valid for 10 days — enabling Quick Deploy
When to use: When you haven't validated recently and want to deploy in one step. Or for non-production deployments where speed matters more than caution.
Risk: If tests fail halfway through, Salesforce auto-rolls back everything. Production is safe but you've wasted time.
Best practice: Always validate separately first — then use Quick Deploy for the actual production deployment.
When to use: Within 10 days of a successful validation. This is the standard approach for production deployments.
Time: Seconds to a few minutes (no test execution!)
Availability: Only available if validation passed within the last 10 days
Why it matters: If you have 800 test classes that take 45 minutes — validate on Sunday night, Quick Deploy Monday morning. Production downtime goes from 45 minutes to 2 minutes.
| Feature | ✅ Validate | 🚀 Deploy | ⚡ Quick Deploy |
|---|---|---|---|
| Runs Apex tests? | ✅ Yes | ✅ Yes | ❌ Uses cache |
| Makes changes? | ❌ No | ✅ Yes | ✅ Yes |
| Speed | Slow (tests run) | Slow (tests run) | Fast (no tests) |
| Prerequisite | None | None | Successful validation within 10 days |
| Best for | Pre-deploy check | One-step deploy | Production deployment |
| Production recommended? | ✅ Always first | ⚠️ Risky alone | ✅ After validation |
Validate
Tests Pass ✅
Quick Deploy
Live! 🚀
XYZ Company's standard release pattern — zero risk, minimal production downtime, and the team comes in Monday morning to a successful deployment.
👤 Section 5 — Profiles & Permission Sets in Change Sets
The most misunderstood area of Change Set deployments — get this wrong and you can break production access
Best practice: Always build new feature access using Permission Sets, not Profiles. Deploy them in Change Sets without fear.
| Scenario | Action |
|---|---|
| New LWC needs access | Create Permission Set, add to Change Set ✅ |
| New custom object access | Create Permission Set, add to Change Set ✅ |
| New field visibility | Add to Permission Set, include in Change Set ✅ |
Profiles are destructive when included in Change Sets — they FULLY OVERWRITE the profile in the target org. Every setting in the profile gets replaced with what's in your Change Set.
- ❌ Profile in sandbox has 50 object permissions → Profile in production has 80 → Deploy sandbox Profile → Production now has only 50 permissions. 30 permissions silently removed!
- ❌ Sales team loses access to 30 objects — they can't do their jobs
- ❌ You get 50 angry Slack messages at 9 AM on Monday
Only include a Profile in a Change Set when you specifically need to deploy Profile-level settings AND you have compared the full Profile between sandbox and production.
| Situation | Include Profile? | Include Permission Set? |
|---|---|---|
| New LWC visibility on page layout | ⚠️ Maybe (for layout assignment) | ✅ Yes (for component access) |
| New custom object CRUD access | ❌ Avoid | ✅ Yes |
| New field visibility | ❌ Avoid | ✅ Yes |
| Default record type assignment | ⚠️ Sometimes needed | ❌ Not applicable |
| Tab visibility for new object | ❌ Avoid | ✅ Yes |
📏 Section 6 — Change Set Limits & Restrictions
Know these before you hit them in production
| Limit | Value | What to Do When You Hit It |
|---|---|---|
| Max files per Change Set | 10,000 files | Split into multiple Change Sets, deploy in dependency order |
| Max total size | 400MB | Split into smaller Change Sets |
| Outbound Change Set expiry | 30 days | Upload again before expiry or re-create |
| Quick Deploy window | 10 days | Re-validate if window expired |
| Min Apex test coverage | 75% overall | Write more test methods before deploying |
- ❌ Cannot delete metadata components (use destructive changes XML — covered in M4)
- ❌ Cannot deploy data records — metadata only
- ❌ Cannot be automated — purely manual process
- ❌ Cannot be cloned or templated — recreate from scratch each time
- ❌ Cannot be used between unrelated orgs (different companies)
- ❌ Cannot deploy from production to sandbox
- ❌ Cannot be rolled back after a successful deployment
- ❌ Cannot partially deploy — all or nothing
| Requirement | Rule |
|---|---|
| Overall org coverage | Minimum 75% to deploy to production |
| Individual trigger coverage | Every trigger must have at least 1% coverage (at least 1 test) |
| Best practice target | 80%+ coverage (XYZ Company targets 85%) |
| Tests must pass | 100% of tests must pass — even one failure blocks deployment |
🔧 Section 7 — Troubleshooting Change Set Failures
Every error explained — and exactly how to fix it
Never panic. Read the error log. Fix the issue. Redeploy.
Error message: "Test failure — MyTestClass.testMethod: System.AssertException: Assertion Failed"
Why it happens: An Apex test class is failing — either because your new code broke existing functionality, or the test is poorly written.
- Step 1: Copy the test class name from the error log
- Step 2: Run that specific test in your sandbox (Setup → Apex Test Execution)
- Step 3: Read the assertion error — what expected vs what got
- Step 4: Fix either the code or the test class
- Step 5: Re-add fixed class to Change Set → Re-upload → Validate again
Error message: "No such column 'Custom_Field__c' on entity 'Account'"
Why it happens: Your Apex class or LWC references a field, object, or component that doesn't exist in the target org AND wasn't included in the Change Set.
- Step 1: Check what component the error is referencing
- Step 2: Go back to your Outbound Change Set in sandbox
- Step 3: Add the missing component (field, object, etc.)
- Step 4: Re-upload → Re-validate
Error message: "Overall code coverage is 68%, which is below the required 75%"
- Step 1: Run all tests in sandbox to see current coverage percentage
- Step 2: Check which Apex classes have low coverage (Setup → Apex Classes → Code Coverage)
- Step 3: Write more test methods for low-coverage classes
- Step 4: Add updated test classes to Change Set → Re-upload → Re-validate
Error message: "Field does not exist: Account.Custom_Field__c — included in Profile: Admin"
Why it happens: Your Profile references a field that exists in sandbox but not yet in production.
- Step 1: Add the missing custom field to your Change Set
- Step 2: OR remove the Profile from the Change Set and configure field visibility manually
Error message: "The flow version referenced is inactive"
- Step 1: In sandbox, make sure the Flow you're deploying is in Active status
- Step 2: Re-add the Flow to the Change Set
- Step 3: Re-upload and validate
Failed
Error Log
Sandbox
Change Set
Again ✅
🗑️ Section 8 — Deleting Components with Change Sets
The most asked question about Change Sets — and the surprising answer
| Method | How | Difficulty |
|---|---|---|
| Manual deletion (Setup UI) | Log into production → Setup → Find component → Delete | Easy |
| Destructive Changes XML (SFDX) | Create destructiveChanges.xml → deploy via CLI | Intermediate (covered in M4) |
| Workbench | Create package.xml + destructiveChanges.xml → deploy via Workbench | Intermediate |
When you learn SFDX (Module 6) and Metadata API (Module 4), you will have programmatic deletion available through destructive changes XML — the professional approach for frequent deletions.
💡 Section 9 — Change Set Best Practices
Professional habits that separate great Salesforce developers from everyone else
| Stage | Checklist Item | Who |
|---|---|---|
| Pre-Deploy | Feature tested in sandbox ✅ | Developer |
| Pre-Deploy | All new Apex has test classes ✅ | Developer |
| Pre-Deploy | Coverage above 85% in sandbox ✅ | Developer |
| Pre-Deploy | Dependencies checked and added ✅ | Developer |
| Pre-Deploy | Change Set named and described ✅ | Developer |
| Deploy | Validated in production ✅ | Admin |
| Deploy | Quick Deployed in maintenance window ✅ | Admin |
| Post-Deploy | Smoke tested in production ✅ | QA |
| Post-Deploy | Deployment logged in tracker ✅ | Admin |
⚠️ Section 10 — Common Change Set Mistakes
Learn from the most expensive mistakes Salesforce teams make
- What happens: Developer deploys directly without validating. A test fails halfway through. Salesforce rolls back. It is 2 AM. You start over.
- The fix: Always validate first. Always. No exceptions.
- What happens: Apex class references a custom field. Custom field not in Change Set. Deployment fails with "No such column" error. 45 minutes of test running — wasted.
- The fix: Always click "View/Add Dependencies" after adding components. Add ALL flagged dependencies.
- What happens: Sandbox Profile has fewer permissions than production (because sandbox is older). Deploying it overwrites production Profile. Users lose access to 20 objects at 9 AM Monday.
- The fix: Use Permission Sets. If you must include a Profile, compare it field by field between sandbox and production first.
- What happens: One massive Change Set with 150 components from 5 different features. Deployment fails. Now you don't know WHICH feature caused it. Roll back everything. Start debugging from scratch.
- The fix: One Change Set per feature. Small, focused, testable.
- What happens: Flow was working in sandbox. Deploy to production. Flow has a hardcoded sandbox record ID that doesn't exist in production. Every time the Flow runs — error. Users start calling support.
- The fix: Never hardcode IDs in Flows. Test Flows in QA sandbox with a fresh dataset that mirrors production. Check all Get Records and Create Records elements carefully.
🚪 Section 11 — When to Graduate Beyond Change Sets
Knowing when you have outgrown Change Sets is a sign of professional maturity
- 🔴 Two developers overwrote each other's work — time for Git branches
- 🔴 You have no idea what is in production vs sandbox — time for version control
- 🔴 Deployment day is stressful and quarterly — time for CI/CD automation
- 🔴 You need to delete components regularly — time for SFDX destructive changes
- 🔴 More than 3 developers on the same project — time for Scratch Orgs
- 🔴 You are deploying to unrelated orgs — time for Metadata API
- 🔴 Business wants features delivered weekly, not quarterly — time for CI/CD
| Module | What You Learn | Replaces |
|---|---|---|
| M4 — Metadata API | package.xml, Workbench, programmatic deploy | Change Set manual process |
| M5 — Git Basics | Version control, branches, commits | No version history problem |
| M6 — SFDX & CLI | sf commands, source format, automation | Manual GUI deployments |
| M7 — Scratch Orgs | Isolated dev environments | Shared sandbox conflicts |
| M11 — GitHub Actions | Full CI/CD automation | Manual deployments entirely |
| Before DevOps (Change Sets Only) | After DevOps (SFDX + CI/CD) |
|---|---|
| Quarterly deployments, 2 AM Sunday stress | Tuesday/Friday deployments, automated |
| Developers overwriting each other | Feature branches, zero conflicts |
| No version history | Full Git audit trail |
| "What's in production?" — nobody knows | Git repo = exact production state |
| 3 months to deliver a feature | 1-2 weeks from idea to production |
📝 Section 12 — Module 3 Quiz
Test your Change Sets mastery before moving to Module 4
🧠 Module 3 Knowledge Check — 10 Questions
📋 Module 3 Summary
Everything you mastered in this module
- ✅ Change Sets are Salesforce's built-in deployment tool — Outbound (send) and Inbound (receive)
- ✅ Deployment Connections must be established between orgs before Change Sets can flow
- ✅ Full 7-step deployment workflow — create, add components, check dependencies, upload, validate, deploy
- ✅ Validate = dry run (no changes). Deploy = actual changes. Quick Deploy = instant deploy using cached validation
- ✅ Always validate first, use Quick Deploy in the maintenance window — the professional standard
- ✅ Permission Sets are safe to include. Profiles are dangerous — they fully overwrite target settings
- ✅ Limits: 10,000 files, 400MB, 75% test coverage, 10-day Quick Deploy window
- ✅ Failed deployments auto-rollback — production is always safe
- ✅ Change Sets cannot delete components — use manual Setup UI or SFDX destructive changes
- ✅ Signs you've outgrown Change Sets: overwrites, no version history, quarterly deployments, 3+ developers
➡️ Next: Module 4 — Metadata API Basics
Learn package.xml, Workbench deploy/retrieve, destructive changes to delete components, and how the Metadata API powers everything under the hood
🚀 Enjoying This Free DevOps Course?
Share it with your Salesforce community. 22,000+ learners this month — all free, forever.
All Free Resources → 75 DevOps Q&As →Structure your answer as What → Why → How. Explain the concept before jumping to code!