Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Apex Classes entry
How-to guide

How to set up Apex Classes in Salesforce

Apex Classes is the Setup page where Apex code lives — class metadata, version, status (Active / Deprecated), test coverage. Most modern orgs deploy Apex via DX or Change Sets, not the Apex Classes Setup page directly. The page is mostly for review and quick edits.

By Dipojjal Chakrabarti · Editor, Salesforce DictionaryLast updated Apr 20, 2026

Apex Classes is the Setup page where Apex code lives — class metadata, version, status (Active / Deprecated), test coverage. Most modern orgs deploy Apex via DX or Change Sets, not the Apex Classes Setup page directly. The page is mostly for review and quick edits.

  1. Open Setup → Apex Classes

    Setup gear → Quick Find: Apex Classes → Apex Classes.

  2. Review the list of classes

    Each row: Name, Last Modified, Status, API Version, Lines of Code (read from Modified Source).

  3. Click New for in-Setup class creation (rare)

    Most code is deployed from outside Setup. The New button creates a class via the inline editor — fine for tiny utility classes, awkward for real development.

  4. Click into a class for source

    Source code, with Compile errors highlighted if any. Edit inline (in production this requires Modify Metadata permission).

  5. For test coverage: click Test → Run Tests

    Runs the test methods on this class. Coverage shown in real time.

  6. For dependency analysis: click Show Dependencies

    Lists what other metadata references this class — useful before deletion.

Key options
API Versionremember

What version of the Salesforce API the class targets. Older versions get fewer Salesforce features.

Statusremember

Active (deployed and running) / Deprecated (callable but flagged for removal).

Compile Errorsremember

Surface inline. Deploy fails if any Apex Class has compile errors.

Gotchas
  • Editing Apex inline in Setup → Apex Classes is allowed in sandboxes by default but requires the Modify Metadata permission in production. Many orgs lock this down.
  • Renaming an Apex class is a destructive operation. References to the old name break — rename via deploy with a careful migration path.
  • API Version locks features available to the class. A class on API 30 can't use Modern Apex features (System.JSON improvements, etc.). Bump to current API only after testing.

See the full Apex Classes entry

Apex Classes includes the definition, worked example, deep dive, related terms, and a quiz.