Apex Classes, Methods, and Sub-Classes: What’s the Difference?

Apex Classes, Methods, and Sub-Classes: What’s the Difference?

One of the questions I get from admins starting to write Apex is: What’s the difference between a class, a method, and a sub-class? It’s an important distinction that’s easy to miss when you're focused on just getting the code to work.

Here’s the breakdown:

  • A Class is the container. Think of it like a toolbox. It can hold properties (data) and methods (actions).

  • A Method is an action the class can perform. It’s like a tool in the box—each method does something specific.

  • A Sub-Class is a class defined inside another class. It’s used for organizing related logic or creating structured data objects within a class.

Writing My First Apex Class (and Keeping It Simple)

Writing My First Apex Class (and Keeping It Simple)

I wrote my first real Apex class this month to support a Flow that needed more logic than the Flow Builder could handle.

Instead of overcomplicating things, I kept it simple:

  • One method

  • One purpose

  • Strong naming and comments

Creating Clean, Reusable Flows with Subflows

Creating Clean, Reusable Flows with Subflows

This year, I started refactoring old Flows using Subflows—and honestly, I should’ve done it sooner.

Breaking complex automation into modular chunks has made everything easier to manage. I now build utility Flows that:

  • Convert date formats

  • Assign ownership based on record data

  • Send templated emails based on input variables

Flow Debugging: How I Actually Find the Problem

Flow Debugging: How I Actually Find the Problem

By now, I’ve built enough Flows to know: when something breaks, it’s rarely where you think it is.

Over time, I’ve built a solid process for debugging Flows efficiently:

  • Start with Debug Logs if the Flow is Record-Triggered—search for the Flow name and trace the path

  • In Flow Builder, use the Debug with Inputs tool with realistic values

• • Log values at key points using Assignment elements (great for sandbox testing)