function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
import { LightningElement,wire } from 'lwc'; import { getPicklistValues } from 'lightning/uiObjectInfoApi'; import caseType from '@salesforce/schema/Case.Type'; import { getObjectInfo } from 'lightning/uiObjectInfoApi'; import CASE_OBJECT from '@salesforce/schema/Case'; export default class DisplayCaseTypeButtonInLwc extends LightningElement { caseTypeData = []; @wire(getObjectInfo, { objectApiName: CASE_OBJECT }) caseInfo; @wire(getPicklistValues, { recordTypeId: '$caseInfo.data.defaultRecordTypeId', fieldApiName: caseType } ) caseTypeValues({data,error}){ if(data){ console.log('data========> ' + JSON.stringify(data)); this.caseTypeData = data.values; } else if (error){ console.log('error========> ' + JSON.stringify(error)); } } } ================================================ <template> <template for:each={caseTypeData} for:item="value"> <lightning-button key={value.value} class="slds-m-right_small" variant="brand" label={value.label} onclick={handleClick}></lightning-button> </template> </template>
https://www.salesforcepoint.com/2020/08/lwc-picklist-get-pick-list-values-with.html#:~:text=Fetching%20and%20Displaying%20Picklist%20Values%20In%20Lightning%20Web,to%20fetch%20picklist%20values%20by%20using%20dynamic%20schema.the
I don't know is there any relationship between contact and case but we can get case picklist values without calling apex.take reference from below code.
if you have recordtype in case object, you can get picklist values by below reference.
in my code I got values without recordType.
don't forget to mark it as the best answer if it helps you.
Thank you