nerdexam
Salesforce

PDII · Question #324

A developer is creating a Lightning web component that displays a list of records in a lightning- datatable. After saving a new record to the database, the list is not updating. What should the…

The correct answer is D. Call refreshApex() on this.data. See the full explanation below for the reasoning.

Question

A developer is creating a Lightning web component that displays a list of records in a lightning- datatable. After saving a new record to the database, the list is not updating. What should the developer change in the code above for this to happen?

Exhibit

PDII question #324 exhibit

Options

  • AAdd the @track decorator to the data variable.
  • BCreate a new variable to store the result and annotate it with @track.
  • CCreate a variable to store the result and call refreshApex().
  • DCall refreshApex() on this.data.

How the community answered

(28 responses)
  • A
    18% (5)
  • B
    4% (1)
  • C
    7% (2)
  • D
    71% (20)

Community Discussion

No community discussion yet for this question.

Full PDII Practice