User Interface25% of the exam

Apex for page components: controllers and wire adapters

Which Apex contract each page component needs: @AuraEnabled methods called by wire or imperatively from Lightning web components, cacheable=true and refreshApex, AuraHandledException errors, @InvocableMethod actions shared by Flow and Agentforce, and Visualforce standard, list, custom and extension controllers.

Official exam objective
Given a scenario, implement Apex to work with various types of page components, including Lightning components, Flow, and Agentforce.

~7 min read · 20 practice questions ·

What the exam expects

  • Expose an Apex method to a Lightning web component and choose between @wire and an imperative call.
  • Explain what cacheable=true allows and forbids, and refresh stale wired data with refreshApex().
  • Return controlled errors from Apex with AuraHandledException and handle them in the component.
  • Write one @InvocableMethod that a flow and an Agentforce agent can both call, with clear labels and a bulk-safe signature.
  • Pick the Visualforce controller type: standard, standard list, custom or extension.

Key terms: @AuraEnabled (the annotation that exposes a static Apex method to Lightning components), cacheable method (a read-only @AuraEnabled method whose results the client caches), imperative call (a promise-returning call your code triggers), invocable action (an @InvocableMethod that Flow, agents and REST can run), controller extension (an Apex class that extends a standard or custom Visualforce controller).

Key facts

LWC-callable Apex
Detail
static, public or global, @AuraEnabled
Overloads
Detail
Not allowed on @AuraEnabled methods from API 55.0
@wire to Apex
Detail
Requires cacheable=true; the method can't change data
Stale wired Apex data
Detail
refreshApex() with the wire-emitted value
Wrapper serialization
Detail
Only @AuraEnabled members are returned
Friendly errors
Detail
Throw AuraHandledException instead of a raw system exception
Invocable per class
Detail
One method; only @Deprecated may accompany it
Invocable input and output
Detail
At most one List parameter; outputs match inputs in size and order
Agent action metadata
Detail
Method and variable labels and descriptions become the action's defaults
List controller page size
Detail
20 records by default
Custom controllers and extensions
Detail
Run in system mode; standard controller logic runs in user mode
Sources for this section (9)
  • Why can't a method that updates records be wired?
  • When does a component need `refreshApex()`?
  • Why label and describe an invocable method used as an agent action?
  • Which Visualforce controller pages Opportunities 20 at a time with little Apex?

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 (20 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