1

I'm making a lightning component with a lightning:recordEditForm and lightning:inputField to edit Contact records.

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride,force:lightningQuickAction">
<aura:attribute name="contact" type="String" />
<aura:attribute name="fieldsContact" type="String[]" />  
<aura:attribute name="goSubmit" type="Boolean" />    
<aura:handler name="change" value="{!v.goSubmit}" action="{!c.goSubmitGo}"/>
<aura:registerEvent name="sendResult" type="c:SMB_Opportunity_Update_Information_Evt"/>

<div>
    <lightning:recordEditForm aura:id="updateContact" objectApiName="Contact" recordId="{!v.contact}"  onerror="{!c.handleError}" onsuccess="{!c.handleSuccess}" >
        <aura:iteration items="{!v.fieldsContact}" var="item">

            <lightning:inputField aura:id="{!item}" fieldName="{!item}" />
        </aura:iteration>
    </lightning:recordEditForm>
</div>

I use a list of String to populate my input fields. Everything works fine when I try to submit my form excepted for the Salutation Field. First of all, it won't display. I already find a workaround by adding this:

<div style="display:none"> 
    <lightning:inputField fieldName="Name"/> 
</div>

at the beggining of my Record Edit Form. But even if I can choose a value for this field, it does not update when I submit my form. All the others fields update well.

Do you know why and if there is a workaround?

  • I would try two things, first check to make sure you have edit access to this field at the object level for the profile you are logged in as. If you do then I would add an onerror method to the recordEditForm and console.log the error it is throwing – Calvin OKeefe Nov 20 '18 at 19:09
  • I have the edit access on this field and there is no error. The field is just not update. – Gwaldhorf Miopau Nov 21 '18 at 9:22
0

I don't know why but it suddenly works.

Probably magic.

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.