New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified Platform Developer II (Plat-Dev-301) Exam - Topic 2 Question 121 Discussion

Actual exam question for Salesforce's Salesforce Certified Platform Developer II (Plat-Dev-301) exam
Question #: 121
Topic #: 2
[All Salesforce Certified Platform Developer II (Plat-Dev-301) Questions]

A developer created a Lightning web component mat allows users to Input a text value that is used to search for Accounts by calling an Apex method. The Apex method returns a list of account to apply and is called imperatively from a JavaScript event handler.

Which two changes should the developer make so the Apex method functions correctly.

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: B, C

Contribute your Thoughts:

0/2000 characters
Brigette
3 days ago
Agreed, line 01 makes the most sense for accessibility.
upvoted 0 times
...
Refugia
8 days ago
Wait, is this a trick question? I'm going with B and C, just to be safe.
upvoted 0 times
...
Shenika
13 days ago
Haha, I bet the developer was scratching their head on this one. B and C are the way to go!
upvoted 0 times
...
Val
18 days ago
Hmm, I was thinking D, but B and C make more sense. Apex can be tricky sometimes.
upvoted 0 times
...
Bobbie
24 days ago
I agree, B and C are the way to go. Gotta love that Apex method!
upvoted 0 times
...
Delila
29 days ago
B and C are the correct answers.
upvoted 0 times
...
Lawrence
1 month ago
I think we need to add @AuraEnabled to the method itself and possibly the parameters. I remember something about making sure the method is accessible from the LWC.
upvoted 0 times
...
Claudia
1 month ago
I’m a bit confused about which lines need the annotation. I thought it was only necessary for the method, but maybe it also applies to the return type?
upvoted 0 times
...
Maxima
1 month ago
This question feels similar to one we practiced where we had to enable an Apex method for LWC. I think it might be line 03 since that's where the method signature is.
upvoted 0 times
...
Lynda
2 months ago
I remember we discussed the importance of the @AuraEnabled annotation for Apex methods, but I'm not sure if it should be on the method itself or just the parameters.
upvoted 0 times
...
Dortha
2 months ago
This seems straightforward. The Apex method is being called from the Lightning web component, so it needs to be marked as @AuraEnabled. I'd go with option B or C to make the necessary changes.
upvoted 0 times
...
Kyoko
2 months ago
I'm a bit confused here. The question mentions the component, but the code snippet doesn't show the component. I'll need to make sure I understand the full context before deciding on the changes.
upvoted 0 times
...
Novella
2 months ago
Wait, why would you add it to line 03? That seems off.
upvoted 0 times
...
Selma
3 months ago
I think line 09 is the right place for @AuraEnabled.
upvoted 0 times
...
Winfred
3 months ago
Definitely need @AuraEnabled on line 01.
upvoted 0 times
...
Jerilyn
3 months ago
I think the key is to identify which part of the Apex code needs to be marked as @AuraEnabled. Based on the options, it seems like either the method itself or the parameters/return type need to be annotated.
upvoted 0 times
...
Myra
3 months ago
Okay, let's see. The question mentions the Apex method being called imperatively, so I'm guessing the issue is with the method not being marked as @AuraEnabled.
upvoted 0 times
...
Brittni
3 months ago
Hmm, this looks like a tricky one. I'll need to carefully review the code to identify the issue and the appropriate changes.
upvoted 0 times
Carissa
2 months ago
I think adding @AuraEnabled to line 01 is crucial.
upvoted 0 times
...
...

Save Cancel