Developer Fundamentals27% of the exam

Declarative or programmatic: choosing the right tool

When a formula field, roll-up summary, validation rule or Flow meets a requirement and when only Apex will do, with the formula and roll-up limits and the shared governor limits that decide the choice.

Official exam objective
Given a scenario, identify common use cases and best practices for declarative versus programmatic customizations, including governor limits, formula fields, and roll-up summaries.

~7 min read · 31 practice questions ·

What the exam expects

  • Given a requirement, choose a formula field, roll-up summary field, validation rule, Flow or Apex, and justify rejecting the others.
  • Know what formula fields cannot do (child records, snapshots, long text) and their size limits.
  • Know where roll-up summaries work, which functions they offer, and how to stage them across levels.
  • Recognize requirements that exceed per-transaction governor limits and need Batch Apex or bulkified code.
  • Key terms: declarative (configured in Setup, no code); programmatic (Apex or other code); formula field (read-only value calculated from the record and its parents); roll-up summary field (aggregate of detail records on the master); governor limit (a per-transaction resource cap shared by all automation in that transaction).

Key facts

Formula length
Detail
3,900 characters; 15,000 bytes saved or compiled
Fields formulas can't use
Detail
Long text area, encrypted, Description
Cross-object reach
Detail
Parents via lookup or master-detail, up to 10 relationships away
Roll-up types
Detail
COUNT, SUM, MIN, MAX
Standard roll-up pairs
Detail
Account from opportunities; Opportunity from opportunity products; Campaign from campaign members
Master-detail to lookup
Detail
Allowed only when no roll-up summary fields exist on the master
Flow limits
Detail
Per-transaction Apex limits govern flows; 100 SOQL, 150 DML
Batch Apex scope
Detail
QueryLocator returns up to 50 million records; each batch is its own transaction
Production Apex
Detail
Unit tests must cover at least 75 percent of the code
Bulk DML
Detail
A list insert counts as one DML statement
Sources for this section (8)
  • Why can't a formula field record the price at the moment an order is submitted?
  • When can a roll-up summary aggregate a formula field?
  • Why doesn't moving trigger logic into a record-triggered flow avoid a SOQL limit error?
  • What must you do before converting a master-detail relationship to a lookup?
  • Which Apex collection guarantees each Account Id appears once?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Platform Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 21 lessons of the Platform Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (31 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Platform Developer exam