In Copado Essentials, depending on the situation, different API versions will be used when retrieving metadata from Salesforce. This article explains how the API version is managed within Essentials.
Deploy From Org to Org
When deploying metadata between Salesforce orgs, Essentials defaults to the latest API version in use. The default API is regularly updated to match the latest Salesforce release.
Commit metadata from Salesforce Org to GIT
Before retrieving metadata from the source Salesforce Org, Essentials automatically detects the API version of the metadata currently stored in the GIT repository.
If the source is in DX format, Essentials looks at the version number from the sfdx-project.json file in the repository.
โIf the source is in MDAPI classic format, Essentials looks at the version from the package.xml file in the repository.
โIf the repository is empty, Essentials uses the latest default API version.
Once the API version number is determined, Essentials will use this version number to retrieve the metadata from the source Salesforce org. This is to make sure that the new retrieved metadata is in the same version as the current code in your GIT repository.
Deploy metadata from GIT to Salesforce Org
When deploying metadata from Git to Salesforce org, Copado Essentials respects the API version defined in package.xml (classic format) or sfdx-project.json (DX-format). If you need to change the API version that Copado Essentials uses, simply update package.xml or sfdx-project.json and commit the changes to your Git repo. Copado Essentials will automatically pick up the updated API version accordingly.
Please note that if you ever update the API version in package.xml or sfdx-project.json, you should also update the content of your metadata files to align with the updated API version.