Deal of The Day! 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

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
B) Add @AuraEnabled to line 03. and C) Add @AuraEnabled to lines 11 and 12.
A) Add @AuraEnabled to line 09.
D) Add @AuraEnabled to line 01.

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
Ryan
2 months ago
True, but we need to ensure all lines are covered for best practice.
upvoted 0 times
...
Ronny
2 months ago
C might not be needed if A is added.
upvoted 0 times
...
Vashti
2 months ago
I’m leaning towards A and C. They seem necessary for the method.
upvoted 0 times
...
Reena
2 months ago
Why not D? It could help with accessibility.
upvoted 0 times
...
Ryan
2 months ago
I agree, but I also feel option B is important too.
upvoted 0 times
...
Ronny
3 months ago
I think option A is crucial. It needs @AuraEnabled to work.
upvoted 0 times
...
Cecily
3 months ago
I’m surprised there’s so much debate over this!
upvoted 0 times
...
Brigette
3 months ago
Agreed, line 01 makes the most sense for accessibility.
upvoted 0 times
...
Refugia
4 months ago
Wait, is this a trick question? I'm going with B and C, just to be safe.
upvoted 0 times
...
Shenika
4 months 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
4 months ago
Hmm, I was thinking D, but B and C make more sense. Apex can be tricky sometimes.
upvoted 0 times
...
Bobbie
4 months ago
I agree, B and C are the way to go. Gotta love that Apex method!
upvoted 0 times
...
Delila
4 months ago
B and C are the correct answers.
upvoted 0 times
...
Lawrence
4 months 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
5 months 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
5 months 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
5 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
5 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
5 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
5 months ago
Wait, why would you add it to line 03? That seems off.
upvoted 0 times
...
Selma
6 months ago
I think line 09 is the right place for @AuraEnabled.
upvoted 0 times
...
Winfred
6 months ago
Definitely need @AuraEnabled on line 01.
upvoted 0 times
...
Jerilyn
6 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
6 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
7 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
Rossana
30 days ago
Let’s not overlook line 12 either; it could be key.
upvoted 0 times
...
Lon
1 month ago
I’d go with lines 01 and 09 for sure.
upvoted 0 times
...
Karima
1 month ago
Don't forget about line 03! It might need @AuraEnabled too.
upvoted 0 times
...
Nikita
2 months ago
Line 09 also seems important for the method to work.
upvoted 0 times
...
Carissa
6 months ago
I think adding @AuraEnabled to line 01 is crucial.
upvoted 0 times
...
...

Save Cancel