function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pratik Raut 14Pratik Raut 14 

Error with Lightning record Edit form. When used lightning record edit form inside lighnting record edit form

There are 2 Lightning components. One is parent and other is child. In parent component  I used lightning record form( <lightning:recordEditForm>) to show custom opportunity object record and inside that record edit form I am calling child component. In child component also I used lightning record edit form for different custom object. My component structure looks like

****PARENT COMPONENT****
<lightning:recordEditForm onload="{!c.handleLoad}" onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" recordId="a00R0000000jq5eIAA" objectApiName="Opportunity__c"><lightning:inputField fieldName="Name" />

<c:ChildComponent />

</lightning:recordEditForm>

****CHILD COMPONENT****

<lightning:recordEditForm onload="{!c.handleLoad}" onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" recordId="a00R0000000jq5eIAA" objectApiName="Bad_Guy__c"><lightning:inputField fieldName="Has_Weakness__c" />

</lightning:recordEditForm>

But while loading this record I am getting error that The field XXXX was not found, And some standard fields(CreatedDate,LastModifiedDate) taking reference from parent recordEditForm, means it showing data for parent object not for child record edit form. Does anyone have resolution for this?

 

Thanks & Regards

Pratik