nerdexam
Salesforce

PDII · Question #39

Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is

The correct answer is D. COUNT() SOQL aggregate query on the Opportunity object. See the full explanation below for the reasoning.

Question

Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?

Options

  • AApex Batch job that counts the number of Opportunity records
  • BSUM() SOQL aggregate query on the Opportunity object
  • CSOQL for loop that counts the number of Opportunities records
  • DCOUNT() SOQL aggregate query on the Opportunity object

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    10% (3)
  • D
    83% (24)

Community Discussion

No community discussion yet for this question.

Full PDII Practice