nerdexam
Salesforce

PDII · Question #308

Refer to the following code snippets: A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in…

The correct answer is B. Use the Cacheable=true attribute in the Apex method. See the full explanation below for the reasoning.

Question

Refer to the following code snippets:

A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data". Which modification should be implemented to the Apex class to overcome the issue?

Exhibit

PDII question #308 exhibit

Options

  • AEdit the code to use the without sharing keyword in the Apex class.
  • BUse the Cacheable=true attribute in the Apex method.
  • CUse the Continuation=true attribute in the Apex method.
  • DEnsure the OWD for the Opportunity object is Public.

How the community answered

(31 responses)
  • A
    16% (5)
  • B
    71% (22)
  • C
    10% (3)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full PDII Practice