Beginner 10 min read

Enums vs Picklists

By the end of this lesson, you'll be able to:

  • Explain what a picklist is, declaratively
  • Compare enums and picklists on where they live and who can change them
  • Decide which one fits a given scenario

Prerequisites: "Declaring and Using Enums"

Two solutions to the same problem

Both an enum and a picklist solve "this value must be one of a fixed set" — just at different layers:

Enum Picklist
Defined in Apex code Object Manager (declarative, no code)
Changed by A developer, via a deployment An admin, via clicks
Lives on A variable, inside your code A field, as part of the data itself

Why this distinction matters

A picklist field's value is stored on the record and visible to reports, list views, and Flow without any Apex involved at all. An enum only exists while your Apex code is running — it's a code-only concept, not something stored on a record by itself. Very often, real Apex code reads a picklist field's value (a String, technically) and converts it into an enum internally, getting the best of both: admin-friendly configuration and compile-time safety inside the code that handles it.

A real business example: Manufacturing

A Production_Batch__c custom object might have a picklist field Status__c with values like In Progress, Quality Check, Complete — configured entirely by an admin, no code required, and instantly visible in any report. Apex code that processes batches might then read that field's value and match it against an internal enum for safer comparisons within the code itself.

Trade-offs and when NOT to use this

Don't reach for an Apex enum when a picklist would genuinely serve better — if business users need to see, filter, or report on the value without a developer's involvement, it belongs on the record as a picklist, not buried inside Apex where only code can see it.

Exercise

A company wants business analysts (not developers) to be able to add a new 'On Hold' status to their order process without a code deployment. Should this be an enum or a picklist? Explain why.

Show hint

Who needs to make the change, and do they have access to write/deploy Apex?

Enums vs Picklists Quiz

1. Who can typically add a new value to a picklist?

2. An enum value is automatically visible in Salesforce reports, the same way a picklist field is.

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

A picklist is Salesforce's declarative, field-level equivalent of an enum — configured by an admin through clicks, not code, and stored as part of the data itself rather than defined in a class.