ExamGecko
Question list
Search
Search

Question 197 - Certified B2B Commerce Developer discussion

Report
Export

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

A.
import { getPicklistvValues } from 'lightning/uiObjectinfoApi';
Answers
A.
import { getPicklistvValues } from 'lightning/uiObjectinfoApi';
B.
import { LightningElement, wire } from 'lwc';
Answers
B.
import { LightningElement, wire } from 'lwc';
C.
import { wire } from 'lwc';
Answers
C.
import { wire } from 'lwc';
D.
import { picklistValues } from 'lightning/uiObjectinfoApi';
Answers
D.
import { picklistValues } from 'lightning/uiObjectinfoApi';
Suggested answer: A, B

Explanation:

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.

asked 23/09/2024
David Murinda
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first