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

Save Cancel