0

When using lightning:recordEditForm I am getting the following error in the <lightning:messages />:

Field does not exist.

Here is the markup I am using:

<lightning:recordEditForm aura:id="trainingRecordEditForm"
                                              recordId="{!v.currentlySelectedId}"
                                              objectApiName="{!v.objectApiName}"
                                              onsuccess="{!c.handleSuccess}" onerror="{!c.handleError}">
                        <lightning:messages />

                        <aura:iteration items="{!v.fields}" var="field">
                            <lightning:inputField fieldName="{!field}" />
                        </aura:iteration>

                        <lightning:inputField class="hiddenField"
                                              fieldName="{!v.fieldWithParentId}"
                                              value="{!v.currentlySelectedId}"/>

                    </lightning:recordEditForm>

Nothing special, really.

Here is the params of the error event: "{"error":{"message":"Field does not exist.","stackTrace":"","data":{"message":"Field does not exist.","statusCode":400,"errorCode":"POST_BODY_PARSE_ERROR"},"id":"1408552758"}}"

What I am doing more precisely:

  1. I open the component successfully.

  2. Change nothing in the fields.

  3. Click button which submits the <lightning:recordEditForm>.

enter image description here

1
  • If your fields are not generated with an aura iteration does it work?
    – glls
    Commented Aug 18, 2018 at 12:43

1 Answer 1

0

Here <lightning:inputField class="hiddenField" fieldName="{!v.fieldWithParentId}" value="{!v.currentlySelectedId}"/> I had v.fieldWithParentId being equal to an empty string.

You must log in to answer this question.

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