5

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
    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 '18 at 23:26
5

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.