I have created a custom Picklist in PricebookEntry and trying to get the Picklist values in LWC. All the solutions I found needs to pass the RecordTypeId to get the list.

@wire(getPicklistValuesByRecordType, { objectApiName: PRICEBOOK_OBJECT, recordTypeId: '$objectInfo.data.defaultRecordTypeId'})

For PricebookEntry, I can't create a Record Type. How can I get the Picklist values without the RecordTypeId?


Use the "null" record type Id, "012000000000000AAA" as the record type Id.

@wire(getPicklistValues, { objectApiName: PRICEBOOK_OBJECT, recordTypeId: '012000000000000AAA'})

This is demonstrated in the documentation.


import { LightningElement,wire } from 'lwc'; import { getPicklistValues } from 'lightning/uiObjectInfoApi'; import LeadSource from '@salesforce/schema/Contact.LeadSource'; import { getObjectInfo } from 'lightning/uiObjectInfoApi'; import CONTACT_OBJECT from '@salesforce/schema/Contact';

export default class LwcPicklistWithoutRecordtypeextends LightningElement { @wire(getObjectInfo, { objectApiName: CONTACT_OBJECT }) contactInfo;

        recordTypeId: '$contactInfo.data.defaultRecordTypeId',
        fieldApiName: LeadSource


Find total code: https://www.salesforcepoint.com/2020/08/lwc-picklist-get-pick-list-values-with.html?m=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.