getPicklistValuesByRecordType
Use this wire adapter to get the values for every picklist of a specified record type.
getPicklistValuesByRecordType uses this User Interface API resource.
| Parameter Name | Type | Description | Required? |
|---|---|---|---|
objectApiName | String | The API name of a supported object. | ![]() |
recordTypeId | String | The ID of the record type. Use the Object Info defaultRecordTypeId property, which is returned from getObjectInfo. | ![]() |
Read the data that's returned by the wire adapter using a property or function.
propertyOrFunction—A private property or function that receives the stream of data from the wire service.
- If a property is decorated with
@wire, the results are returned to the property’sdataproperty orerrorproperty. - If a function is decorated with
@wire, the results are returned in an object with adataproperty and anerrorproperty.
data—Picklist Values Collectionerror—FetchResponse
Picklist values are scoped to a record type. getPicklistValuesByRecordType returns a collection of picklist values for all of the picklists of a specified record type. For more information, see Build UI for Picklists.
To retrieve picklist values for a specific field, use getPicklistValues instead.
See the wireGetPicklistValuesByRecordType component in the lwc-recipes GitHub repo.
See Also
