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 B2B Commerce for Developers Accredited Professional (AP-202) Exam - Topic 4 Question 54 Discussion

Actual exam question for Salesforce's B2B Commerce for Developers Accredited Professional (AP-202) exam
Question #: 54
Topic #: 4
[All B2B Commerce for Developers Accredited Professional (AP-202) Questions]

Which two items are required for a developer to bring picklist values into a Lightning Web Component?

Show Suggested Answer Hide Answer
Suggested Answer: A, B

To bring picklist values into a Lightning Web Component (LWC), a developer needs to import specific modules from the lwc and lightning/uiObjectInfoApi namespaces. The getPicklistValues function from the lightning/uiObjectInfoApi module is used to fetch the picklist values based on record type and field metadata. Additionally, importing { LightningElement, wire } from lwc is essential for defining the LWC class and using the @wire decorator to wire the getPicklistValues to a property or function. Salesforce documentation on LWC and utilizing the uiObjectInfoApi provides clear guidelines on how to implement this functionality.


Contribute your Thoughts:

0/2000 characters
Janessa
3 months ago
I agree with A and D, but I’m surprised it’s not just A and B!
upvoted 0 times
...
Jaleesa
3 months ago
Wait, is D really necessary? I thought it was just A and B.
upvoted 0 times
...
Erinn
3 months ago
A and D sound right to me too!
upvoted 0 times
...
Hayley
4 months ago
I think A and D are the right ones.
upvoted 0 times
...
Carlee
4 months ago
Definitely need A and B for that!
upvoted 0 times
...
Jose
4 months ago
I definitely remember that `getPicklistValues` is crucial, but I can't remember if we need `picklistValues` or something else from the API.
upvoted 0 times
...
Joseph
4 months ago
I know `import { LightningElement, wire } from 'lwc';` is essential for any LWC, but I’m unsure if it directly relates to picklist values.
upvoted 0 times
...
Pok
4 months ago
I think we practiced a question similar to this, and I feel like both A and D might be correct, but I can't recall clearly.
upvoted 0 times
...
Alesia
5 months ago
I remember we discussed the importance of using `getPicklistValues` for retrieving picklist values, but I'm not sure if that's the only import needed.
upvoted 0 times
...
Wynell
5 months ago
Okay, let me think this through step-by-step. We need to access picklist values in a Lightning Web Component, so we'll definitely need to import something from the lightning/uiObjectinfoApi module. I believe the function we need is getPicklistValues, not picklistValues. And we'll also need to import LightningElement and wire from lwc. So I think the answer is B and D.
upvoted 0 times
...
Jeniffer
5 months ago
Hmm, I'm a bit unsure about this one. I know we need to import something from the lightning/uiObjectinfoApi, but I can't remember the exact function name. And I'm not sure if we need to import LightningElement and wire or not. I'll have to think this through carefully.
upvoted 0 times
...
Fabiola
5 months ago
I'm pretty confident I know the answer to this one. I think it's B and D - we need to import LightningElement and wire from lwc, as well as the picklistValues function from lightning/uiObjectinfoApi.
upvoted 0 times
...
Luther
5 months ago
I'm a little confused on this one. I know we need to import something from the lightning/uiObjectinfoApi module, but I can't remember the exact function name. And I'm not sure if we need to import LightningElement and wire or not. I'll have to review my notes and the documentation to make sure I have the right approach.
upvoted 0 times
...
Carol
5 months ago
Option C, shouting when off the phone, sounds like a bad idea. That could just create more stress for myself and those around me. I think I'll avoid that one.
upvoted 0 times
...
Truman
5 months ago
You know, I was just thinking that dragging an empty Map visualization onto the data might be the simplest solution. Option D seems worth a shot.
upvoted 0 times
...
Kina
2 years ago
Haha, I bet the exam writer is trying to trip us up with these tricky options. But I'm pretty sure D is the right answer.
upvoted 0 times
...
Mitsue
2 years ago
Wait, don't we also need to import 'LightningElement' to create a Lightning Web Component? I think B is also required.
upvoted 0 times
...
Pearlie
2 years ago
Ah, I see! We need to import 'wire' and 'picklistValues' from the 'lightning/uiObjectinfoApi' module. Looks like the correct answer is D.
upvoted 0 times
Son
2 years ago
Actually, the correct answer is D. We need to import 'picklistValues' from 'lightning/uiObjectinfoApi'.
upvoted 0 times
...
Yoko
2 years ago
Great, thanks for clarifying!
upvoted 0 times
...
Evangelina
2 years ago
Yes, that's correct. So the answer is D.
upvoted 0 times
...
Jina
2 years ago
Yes, you're right! We also need to import 'LightningElement' from 'lwc'. That's option B.
upvoted 0 times
...
Kattie
2 years ago
Yeah, that's correct. The answer is D.
upvoted 0 times
...
Raymon
2 years ago
I think we need to import 'wire' and 'picklistValues' from the 'lightning/uiObjectinfoApi' module.
upvoted 0 times
...
Johnson
2 years ago
I think we need to import 'wire' and 'picklistValues' from the 'lightning/uiObjectinfoApi' module.
upvoted 0 times
...
...
Cherrie
2 years ago
Hmm, I think we need both 'wire' and 'picklistValues' to get the picklist values. The 'getPicklistValues' method doesn't seem to exist.
upvoted 0 times
Tori
2 years ago
So, the correct options are B) and D).
upvoted 0 times
...
Ty
2 years ago
Agreed, 'getPicklistValues' is not a valid method for this purpose.
upvoted 0 times
...
Olive
2 years ago
Yes, we need 'wire' to establish the connection and 'picklistValues' to fetch the values.
upvoted 0 times
...
Leslee
2 years ago
D) import { picklistValues } from 'lightning/uiObjectinfoApi';
upvoted 0 times
...
Galen
2 years ago
C) import { wire } from 'lwc';
upvoted 0 times
...
Mickie
2 years ago
B) import { LightningElement, wire } from 'lwc';
upvoted 0 times
...
Angelica
2 years ago
A) import { getPicklistvValues } from 'lightning/uiObjectinfoApi';
upvoted 0 times
...
...

Save Cancel