Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
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 (?) , you can switch to a simple comment.
Switch to a voting comment New
JCTheGenius
Highly Voted 3 years, 2 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, 11 months ago
Answer A is Right @wire property
upvoted 9 times
...
aregas
Most Recent 5 months, 3 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
1 year ago
Its A if you are defining it in a LWC .js file
upvoted 2 times
...
Keiyo
1 year, 2 months 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
2 years, 1 month ago
A is correct. You don't use Aura for LWC. You use wire
upvoted 7 times
...
MuzaffarMoiz
3 years, 1 month 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 ...