Get picklist values based on Record Types in LWC
Let's look at how to fetch picklist values based on record types in LWC.
Am sure by now you are aware that we can create different business processes using picklist fields and record types.
As in, based on the record type we can selectively show values of the picklist field. And this is possible only with pick-list fields and not with other fields.
In LWC when you need to fetch values of a picklist (but not all the values) based on the record type there is a helper method that we can make use of and it's called getPicklistValuesByRecordType
Let's look at the snippet!
Here is the LWC controller file (check the comments).
This is lot more handy than we trying to write the code to generate the values on the fly.
Hope this was helpful!