Apex Classes
Apex Classes is a Setup page that lists all Apex classes in the org, including their namespace, API version, status, and size.
Definition
Apex Classes is a Setup page that lists all Apex classes in the org, including their namespace, API version, status, and size. Administrators and developers use this page to view, create, edit, compile, and manage Apex classes, as well as to schedule Apex jobs and check code coverage.
In plain English
“Here's a simple way to think about it: Apex Classes is the inventory page of every custom code class in your org. Every class some developer wrote, every class a managed package installed - they're all listed here, with their version, status, and last-modified date.”
Worked example
A developer at Cresthaven Logistics navigates to Setup ▸ Apex Classes to review the 320 classes in the org ahead of a deploy. She filters to classes with "Handler" in the name, spots a "LeadAssignmentHandler" that's throwing warnings in production logs, clicks Edit to rework the bulk logic, then runs its associated test class directly from the Apex Classes page. All tests pass with 94% coverage, so she commits the change to her DX Project and queues it in the next Release Train.
Why Apex Classes is the inventory of every code class running in your org
Apex Classes is the Setup page that lists every Apex class currently deployed - name, namespace, API version, status, size. For an admin auditing the org's code surface, this is the canonical inventory. New classes appear here when developers deploy them; old classes linger here until somebody deletes them. Code coverage, scheduled-job assignment, and class-level operations all happen from this page.
The reason it earns regular admin attention even on orgs with dedicated dev teams is that Apex code accumulates the way Custom Objects do. A managed package's classes show up here, a former contractor's classes sit unused for years, classes from old features still reference fields that don't exist. Audit the list quarterly with the dev team, archive what's unused, and prevent the org from carrying years of unmaintained code that nobody understands.
How to set up Apex Classes
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.
- Open Setup → Apex Classes
Setup gear → Quick Find: Apex Classes → Apex Classes.
- Review the list of classes
Each row: Name, Last Modified, Status, API Version, Lines of Code (read from Modified Source).
- 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.
- Click into a class for source
Source code, with Compile errors highlighted if any. Edit inline (in production this requires Modify Metadata permission).
- For test coverage: click Test → Run Tests
Runs the test methods on this class. Coverage shown in real time.
- For dependency analysis: click Show Dependencies
Lists what other metadata references this class — useful before deletion.
What version of the Salesforce API the class targets. Older versions get fewer Salesforce features.
Active (deployed and running) / Deprecated (callable but flagged for removal).
Surface inline. Deploy fails if any Apex Class has compile errors.
- 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.
How organizations use Apex Classes
Quarterly review of Apex Classes catches unused code from former contractors; the team removes ~10% of the catalog each year as deliberate technical-debt cleanup.
Compliance reviews use Apex Classes as the inventory for security audits; every class is mapped to its purpose and risk classification.
DevOps teams cross-reference Apex Classes against version control to identify drift between deployed code and the canonical Git repository.
Trust & references
Straight from the source - Salesforce's reference material on Apex Classes.
- Apex ClassesSalesforce Developers
Hands-on resources to go deeper on Apex Classes.
Test your knowledge
Q1. What is a Governor Limit in the context of Apex Classes?
Q2. Where would a developer typically work with Apex Classes?
Q3. What is required before deploying Apex Classes-related code to production?
Discussion
Loading discussion…