Sub topic 2
API Versions and Keeping Metadata Compatible
Assume you know Salesforce Setup, sandboxes, Flow, and basic Apex. This chapter also assumes you can run Salesforce CLI commands.
API versions and metadata compatibility
An API version identifies the Salesforce platform behavior and metadata format that a deployment targets. The sourceApiVersion value in sfdx-project.json controls the API version used by Salesforce CLI source operations.
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"sourceApiVersion": "65.0"
}Do not raise this value automatically when a new release appears. First test your metadata and integrations. Some components gain new behavior, validation rules, or supported settings. Keep the project version unchanged when you need stable deployments, then raise it deliberately after testing.
Assessing release impact
Start with the release notes and filter by the products, editions, and features your org uses. Then compare each change with your own configuration.
Record:
- The affected feature, Flow, Apex class, integration, or user group.
- Whether the change is available now, optional, or enforced later.
- The test environment and test case needed.
- The owner and deadline for the decision.
Release Updates in Setup are especially important. An update may be optional during one release and enforced in a later release. Test the new behavior before its enforcement date, even if your current org still uses the old behavior.
Choosing sandbox release tracks
A preview sandbox is upgraded before production. Use it to test new platform behavior. Keep another sandbox on the current release when you need a stable comparison with production.
| Sandbox choice | Main purpose |
|---|---|
| Preview sandbox | Test upcoming behavior and release changes |
| Non-preview sandbox | Compare with the current production behavior |
Check Salesforce’s published sandbox schedule and your sandbox instance before deciding. Avoid placing every testing environment on the same release.
Pre-release orgs and regression testing
A pre-release org or preview scratch org provides an isolated place to test new metadata. For example, this definition requests the upcoming release:
{
"orgName": "Release Preview Org",
"edition": "Developer",
"release": "Preview"
}Create it with the CLI:
sf org create scratch \
--definition-file config/project-scratch-def.json \
--alias preview-org \
--duration-days 7 \
--set-defaultTest Apex, Flow paths, permissions, integrations, and key user journeys. Compare results with a non-preview environment. Run automated tests first, then perform focused manual checks for changed features.
Exercise
Why keep a non-preview sandbox during release testing?
Show answer
It provides a current-release comparison, making it easier to identify behavior caused by the upcoming upgrade.