Apex classes and triggers saved at API versions 9.0 through 19.0 will be retired in a future release. The Apex compiler now warns you when you compile or deploy Apex code at these API versions. To prepare for this future retirement, identify and update your Apex classes and triggers to API version 20.0 or later.
Where: This change applies to Apex API versions 9.0 through 19.0 in Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions. The compiler warnings appear in development tools that surface compiler output, including Setup, the Salesforce CLI, Salesforce Extensions for VS Code, Web Console, and Tooling API.
How: If you deploy Apex classes and triggers with API versions 9.0 through 19.0, the Apex compiler returns this warning: Apex API version {XX} is scheduled for retirement. Update to the latest API version to avoid compile failures. If you compile Apex via the Apex Classes or Apex Triggers pages in Setup, compiler warnings identify classes or triggers that are saved at API versions 9.0 through 19.0.
To address these warnings, update the identified classes or triggers to Apex API version 20.0 or later. Salesforce strongly recommends that you use the latest available Apex API version. After updating the Apex API version, test your code thoroughly. Review previous Release Notes for each major version to understand potential changes. For a summary of major behavior changes per Apex API version, review Apex Versioned Behavior Changes in the Apex Developer Guide. Then deploy the updated classes using your standard deployment process.