6

I'm using the lightning:recordEditForm with lightning:inputField and it's going quite successfully. However, I've run into an issue with the Contact.Salutation field. It works when it's a part of the Contact.Name compound field, but I need to customize things further so am using the individual fields instead.

Other picklist values on custom objects work fine, but with the Salutation field, I get the following error thrown by the recordEditForm: "Error in $A.getCallback() [Could not find picklist values for field [Salutation]]"

<lightning:recordEditForm objectApiName="Contact">
    <lightning:inputField fieldName="Salutation"/>
    <lightning:inputField fieldName="FirstName"/>
    <lightning:inputField fieldName="LastName"/>
</lightning:recordEditForm>

Regardless if an existing recordId is provided or not, I get the same error.

Any thoughts? Has anyone else found this?

1
  • 1
    You may like to reach out to Salesforce support. I was able to replicate the issue you reported, looks like it's specific to the Salutation field.
    – Jayant Das
    Apr 18, 2018 at 23:26

2 Answers 2

8

I got the same issue while working on recordEditForm. I usd the below hack/workaround to fix it. It worked for me.

<lightning:recordEditForm objectApiName="Contact">
   <div style="display:none">
      <lightning:inputField fieldName="Name"/>
    </div>
    <lightning:inputField fieldName="Salutation"/>
    <lightning:inputField fieldName="FirstName"/>
    <lightning:inputField fieldName="LastName"/>
</lightning:recordEditForm>
1
  • Awesome, totally works! Where did you find this?
    – Shanerk
    Jun 7, 2020 at 22:52
0

Have you tried using the lightning:inputName element? It allows you to specify the fields that you need from the name compound and show them onto the page?

For more detailed information, please see the link: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_inputName.htm

1
  • Per the docs, it doesn't load the picklist values for salutation.
    – Shanerk
    Jun 7, 2020 at 22:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .