I am working on a Lightning Component and want to create a record using lightning:recordEditForm
. using lightning:recordEditForm
is great because it allows us to create records without Apex.
However, I need to pass a RecordTypeId to that component and that's where I get stuck. I would like to find the proper recordTypeId clientside so that I don't need an Apex controller that queries the recordTypes and returns them just so I can select the proper Id given a recordType name.
Is it possible to do it entirely clientside?
With the new Lightning Web Components, we have a wire adapter to get Object Info: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_wire_adapters_object_info
Is there something similar for the 'classic' Lightning Components? Maybe with the Lightning Data Service?