Trying to figure out how to pass the recordType into a "CreateRecord" method in a LightningWebComponent. Currently, I'm hard coding the id and passing it with the rest of the values, but that is causing a lead to not get created.

The code is as follows:

    leadInput.fields.recordTypeId = '0000000012312'; 
        .then(lead => {
                type: 'standard__recordPage',
                attributes: {
                    actionName: 'view',
                    recordId: lead.id

            _parent.persons = [
                    recordId: lead.id,
                    name: personName,
                    icon: 'standard:lead'
        .catch(error => {

Any insights you can give, would be great. Thanks,

Your Answer

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

Browse other questions tagged or ask your own question.