Skip to main content

Code reviews rule: Use of deprecated: API version

Written by David Martin
Updated this week

Use of deprecated: API version

Why is this an issue?

Using outdated API versions in your metadata can limit your access to new features and security patches as well as causing bugs. Salesforce recommends keeping metadata at a recent API version to benefit from the latest features and fixes. Any components with a metadata API version of 30 or less will be flagged as deprecated based on Salesforce's latest guidance.

Examples

Example of an Apex Class with an outdated API version:

<ApexClass>
<apiVersion>29.0</apiVersion>
<status>Active</status>
</ApexClass>

Other similar examples where the corresponding meta configuration xml file contains API versions configuration may include:

  • AuraDefinitionBundle

  • LightningComponentBundle

  • ApexTrigger

  • ApexPage

  • ApexComponent

How can I fix violations?

Update the API version to a supported version for these components. Be sure to check release notes for breaking changes when updating the API version as some functionality may change and some features may be unavailable in later versions. Be sure to test these changes thoroughly.

When should I disable this rule?

You may have some projects that require specific API versions that are older or out of support. If you are doing this intentionally, consider the security risks and feature gaps for your organisation.

Resources

Did this answer your question?