exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 184 discussion

Actual exam question from Salesforce's CRT-450
Question #: 184
Topic #: 1
[All CRT-450 Questions]

An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web components to use.
What is the correct definition of a Lightning Web component property that uses the getAccounts method?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: C

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JCTheGenius
Highly Voted 2 years, 11 months ago
The code of C would be in the controller. In the lightning component it is the code related with the @wire property. The right syntax of it is A. Please refer to : https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_wire_method
upvoted 15 times
...
KjlK
Highly Voted 2 years, 8 months ago
Answer A is Right @wire property
upvoted 9 times
...
aregas
Most Recent 2 months, 4 weeks ago
A - Lightning web components can import methods from Apex classes. The imported methods are functions that the component can call either via @wire or imperatively. https://developer.salesforce.com/docs/platform/lwc/guide/apex.html The @wire decorator tells getRecord to get the values of the specified fields on the record with the specified $recordId. The $ means that the value is passed dynamically. When the value changes, the wire service provisions data and the component rerenders. https://developer.salesforce.com/docs/platform/lwc/guide/data-wire-example.html
upvoted 2 times
...
SanjeevOnForce
9 months, 3 weeks ago
Its A if you are defining it in a LWC .js file
upvoted 2 times
...
Keiyo
11 months, 1 week ago
A import { LightningElement, wire } from 'lwc'; import getAccounts from '@salesforce/apex/YourApexClass.getAccounts'; export default class YourLWCComponent extends LightningElement { searchTerm = ''; // Initialize searchTerm property @wire(getAccounts, { searchTerm: '$searchTerm' }) accounts; // Rest of your component code... }
upvoted 2 times
...
ApexMike
1 year, 10 months ago
A is correct. You don't use Aura for LWC. You use wire
upvoted 7 times
...
MuzaffarMoiz
2 years, 10 months ago
Yes, Answer is A (@wire) property used in LWC component
upvoted 8 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago