Courseiva
User InterfacemediumMultiple ChoiceObjective-mapped

SALESFORCE-PD1 User Interface Practice Question

A developer is creating a Lightning Web Component that needs to display a list of Accounts. The developer wants to fetch the data imperatively when a user clicks a button rather than automatically via a wire adapter. What is the correct approach?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Call the imported Apex method as a JavaScript function inside the button's event handler and handle the returned promise.

Imperative Apex calls are invoked as standard JavaScript promises, typically triggered by an event handler such as a button click.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the @api track decorator on the Apex method call inside the template.

    Why it's wrong here

    Incorrect because @api track is not used for calling Apex methods.

  • Use the @wire decorator on an imported Apex method and update a reactive property.

    Why it's wrong here

    Incorrect because @wire is used for reactive, automatic provisioning of data, not imperative invocation.

  • Configure the component metadata file to fetch the data imperatively on load.

    Why it's wrong here

    Incorrect because metadata configuration does not determine whether data is fetched imperatively.

  • Call the imported Apex method as a JavaScript function inside the button's event handler and handle the returned promise.

    Why this is correct

    Correct because imperative Apex is called as a function returning a promise inside an event handler.

About these practice questions

One of 493 original SALESFORCE-PD1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official Salesforce exam blueprint

This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.