Use of deprecated: Salesforce API (21-30)
Why is this an issue?
Using outdated API versions in your metadata can cause:
Missing features: Newer API capabilities are not available.
Potential bugs: Older versions may have known issues fixed in later releases.
Future compatibility: Very old API versions may be retired entirely.
Salesforce recommends keeping metadata at a recent API version to benefit from the latest features and fixes.
Examples
Example of incorrect metadata (retired API version):
<ApexClass>
<apiVersion>21.0</apiVersion>
<status>Active</status>
</ApexClass>
Example of correct metadata (current API version):
<ApexClass>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
How can I fix violations?
Update the API version: Change the
<apiVersion>element in your metadata files to a recent version.Test after updating: Some behavior may change between API versions, so test thoroughly.
Update systematically: Consider updating all metadata to the same API version for consistency.
Resources
