You need to sign in to do that
Don't have an account?
mahesh p 54
how to fetch stage picklist values of Opportunity in lightning component
<aura:component implements="force:hasRecordId, flexipage:availableForAllPageTypes"> <div class="slds-grid"> <div class="slds-tabs--path" role="application"> <ul class="slds-tabs--path__nav" role="tablist"> <li class="slds-tabs--path__item slds-is-complete" role="presentation"> <a class="slds-tabs--path__link" id="tabs-path-1" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive"> <span class="slds-tabs--path__stage"> <lightning:icon iconName="utility-sprite:check" alternativeText="Approved" /> <span class="slds-assistive-text">Stage Complete</span> </span> <span class="slds-tabs--path__title">Contacted</span> </a> </li> <li class="slds-tabs--path__item slds-is-complete" role="presentation"> <a class="slds-tabs--path__link" id="tabs-path-1" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive"> <span class="slds-tabs--path__stage"> <lightning:icon iconName="utility-sprite:check" alternativeText="Approved" /> <span class="slds-assistive-text">Stage Complete</span> </span> <span class="slds-tabs--path__title">Open</span> </a> </li> <li class="slds-tabs--path__item slds-is-current" role="presentation"> <a class="slds-tabs--path__link" id="tabs-path-1" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive"> <span class="slds-tabs--path__stage"> <lightning:icon iconName="utility-sprite:check" alternativeText="Approved" /> </span> <span class="slds-tabs--path__title">Unqualified</span> </a> </li> <li class="slds-tabs--path__item slds-is-incomplete" role="presentation"> <a class="slds-tabs--path__link" id="tabs-path-1" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive"> <span class="slds-tabs--path__stage"> <lightning:icon iconName="utility-sprite:check" alternativeText="Approved" /> </span> <span class="slds-tabs--path__title">Nurturing</span> </a> </li> <li class="slds-tabs--path__item slds-is-incomplete" role="presentation"> <a class="slds-tabs--path__link" id="tabs-path-1" aria-controls="content-path-1" aria-selected="false" tabindex="-1" role="tab" href="javascript:void(0);" aria-live="assertive"> <span class="slds-tabs--path__stage"> <lightning:icon iconName="utility-sprite:check" alternativeText="Approved" /> </span> <span class="slds-tabs--path__title">Closed</span> </a> </li> </ul> </div> </div> </aura:component>Without providing Contacted like this and without using lightning:picklistpath,lightning:path i need to get the picklist values and display the stageName in the path.
You have to use the API name of pick list field from the corresponding page in picklistFieldApiName parameter. below am using the Stage from Opportunity like that you have to mention. You have to drag the below lightning component in any lightning detail page but you to use the proper API name of the picklist from that object.
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" >
<lightning:picklistPath aura:id="picklistPath" recordId="{!v.recordId}"
variant="linear"
picklistFieldApiName="StageName">
</lightning:picklistPath>
</aura:component>
Reference Links:
https://rajvakati.com/2018/05/10/usage-of-lightningpicklistpath/
https://developer.salesforce.com/docs/component-library/bundle/lightning:picklistPath/documentation
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Maharajan.C