[SalesForce] Lightning InputField component with Salutation field

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?

Best Answer

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>
Related Topic