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 Exam B2B-Commerce-Developer Topic 4 Question 54 Discussion

Actual exam question for Salesforce's B2B-Commerce-Developer exam
Question #: 54
Topic #: 4
[All B2B-Commerce-Developer 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:

Kina
3 months 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
3 months 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
3 months 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 months ago
Actually, the correct answer is D. We need to import 'picklistValues' from 'lightning/uiObjectinfoApi'.
upvoted 0 times
...
Yoko
2 months ago
User 3: Great, thanks for clarifying!
upvoted 0 times
...
Evangelina
2 months ago
User 2: Yes, that's correct. So the answer is D.
upvoted 0 times
...
Jina
2 months ago
Yes, you're right! We also need to import 'LightningElement' from 'lwc'. That's option B.
upvoted 0 times
...
Kattie
2 months ago
User 2: Yeah, that's correct. The answer is D.
upvoted 0 times
...
Raymon
2 months ago
User 1: I think we need to import 'wire' and 'picklistValues' from the 'lightning/uiObjectinfoApi' module.
upvoted 0 times
...
Johnson
2 months ago
User 1: I think we need to import 'wire' and 'picklistValues' from the 'lightning/uiObjectinfoApi' module.
upvoted 0 times
...
...
Cherrie
3 months 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 months ago
So, the correct options are B) and D).
upvoted 0 times
...
Ty
2 months ago
Agreed, 'getPicklistValues' is not a valid method for this purpose.
upvoted 0 times
...
Olive
2 months ago
Yes, we need 'wire' to establish the connection and 'picklistValues' to fetch the values.
upvoted 0 times
...
Leslee
2 months ago
D) import { picklistValues } from 'lightning/uiObjectinfoApi';
upvoted 0 times
...
Galen
3 months ago
C) import { wire } from 'lwc';
upvoted 0 times
...
Mickie
3 months ago
B) import { LightningElement, wire } from 'lwc';
upvoted 0 times
...
Angelica
3 months ago
A) import { getPicklistvValues } from 'lightning/uiObjectinfoApi';
upvoted 0 times
...
...

Save Cancel