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 NameTypeDescriptionRequired?
objectApiNameStringThe API name of a supported object.Yes
recordTypeIdStringThe ID of the record type. Use the Object Info defaultRecordTypeId property, which is returned from getObjectInfo.Yes

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’s data property or error property.
  • If a function is decorated with @wire, the results are returned in an object with a data property and an error property.

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