nerdexam
Salesforce

PDII · Question #386

Consider the Apex controller below, that is called from an Aura component. What is wrong with this code?

The correct answer is C. Line 6: method must be static. See the full explanation below for the reasoning.

Question

Consider the Apex controller below, that is called from an Aura component. What is wrong with this code?

Exhibit

PDII question #386 exhibit

Options

  • ALine 1: class must be global
  • BLines 1 and 6: class and method must be global
  • CLine 6: method must be static
  • DLine 8: method must first serialize the list to JSON before returning

How the community answered

(47 responses)
  • A
    13% (6)
  • B
    4% (2)
  • C
    77% (36)
  • D
    6% (3)

Community Discussion

No community discussion yet for this question.

Full PDII Practice