You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieve picklist values dynamically of Opportunity Object without apex class using ‘uiObjectInfoApi’ property and displaying the selected pick-list value in Salesforce Lightning Component — LWC
#39
Open
vijayk3327 opened this issue
Jul 14, 2023
· 0 comments
In this post we are going to learn about how to Retrieve picklist values dynamically of Opportunity Object fields of StageName without apex class using ‘uiObjectInfoApi’ property and displaying the selected pick-list value in Salesforce Lightning Component — LWC.
In this post we are going to learn about how to Retrieve picklist values dynamically of Opportunity Object fields of StageName without apex class using ‘uiObjectInfoApi’ property and displaying the selected pick-list value in Salesforce Lightning Component — LWC.
→ Get source code live demo link:-
Step 1:- Create Lightning Web Component HTML ➡ picklistValueLWC.html
`
Step 2:- Create Lightning Web Component Javascript ➡ picklistValueLWC.js
` import { LightningElement, wire, api, track } from 'lwc';
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
import { getPicklistValues } from 'lightning/uiObjectInfoApi';
import Opportunity_OBJECT from '@salesforce/schema/Opportunity';
import StageName_FIELD from '@salesforce/schema/Opportunity.StageName';
export default class PicklistValueLWC extends LightningElement {
StageValue ='';
Prospecting= '';
Qualification = '';
NeedsAnalysis = '';
ValueProposition = '';
IdDecisionMakers = '';
PerceptionAnalysis = '';
}`
Step 3:- Create Lightning Web Component Meta XML ➡ picklistValueLWC.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>45.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> </targets> </LightningComponentBundle>
→ Get source code live demo link:-
The text was updated successfully, but these errors were encountered: