nerdexam
Salesforce

PDI · Question #106

Refer to the code snippet below: When a Lightning web component is rendered, a list of apportunities that match certain criteria shopuld be retrievved from the database and displayed to the end…

The correct answer is A. The method must specify the (cacheable-trun) attribute D. The method cannot mutate the result set retrieved from the database. E. The method must be annotated with the AureEnabled annolation. For an Apex method to be consumable by a Lightning Web Component, it must be annotated with @AuraEnabled, marked cacheable=true for client-side caching, and cannot mutate the retrieved result set if it's cacheable.

Submitted by valeria.br· Apr 18, 2026User Interface

Question

Refer to the code snippet below:

When a Lightning web component is rendered, a list of apportunities that match certain criteria shopuld be retrievved from the database and displayed to the end user. Which three Considerations must the developer implement to make the method available within the Lightning web component? Choose 3 answer

Options

  • AThe method must specify the (cacheable-trun) attribute
  • BThe method must specify the (continuation-true) attribute
  • CThe method must be annotaled with true Invocablemethod annolation
  • DThe method cannot mutate the result set retrieved from the database.
  • EThe method must be annotated with the AureEnabled annolation

How the community answered

(47 responses)
  • A
    96% (45)
  • B
    2% (1)
  • C
    2% (1)

Why each option

For an Apex method to be consumable by a Lightning Web Component, it must be annotated with `@AuraEnabled`, marked `cacheable=true` for client-side caching, and cannot mutate the retrieved result set if it's `cacheable`.

AThe method must specify the (cacheable-trun) attributeCorrect

The `@AuraEnabled(cacheable=true)` annotation allows the method to be cached on the client-side, which improves performance for read-only operations by reducing server round trips.

BThe method must specify the (continuation-true) attribute

The `(continuation=true)` attribute is not a standard `@AuraEnabled` parameter for LWC methods; continuations are a specific feature for calling external web services with long-running requests in Apex.

CThe method must be annotaled with true Invocablemethod annolation

The `@InvocableMethod` annotation is used for exposing Apex methods to Salesforce flows, processes, or other invocable contexts, not directly to Lightning web components.

DThe method cannot mutate the result set retrieved from the database.Correct

An `@AuraEnabled(cacheable=true)` method cannot mutate the data it retrieves or performs DML operations, as caching implies a read-only idempotent operation; if it were to mutate data, the cached result would be stale.

EThe method must be annotated with the AureEnabled annolationCorrect

The `@AuraEnabled` annotation is mandatory for any Apex method that needs to be called from a Lightning component (LWC or Aura) to expose it to the client-side controller.

Concept tested: Apex for Lightning Web Components

Source: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_call_server_methods

Topics

#Apex#Lightning Web Components#AuraEnabled#Data Retrieval

Community Discussion

No community discussion yet for this question.

Full PDI Practice