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

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77