0

i'm trying to display Account information on a Contact and using lightning component with recordeditform. i get all the contact data but I'm not seeing any data in the component but when i open my console i see following warning. enter image description here
here is the code for lightning component.

 <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
        <aura:attribute name="recordId" type="String" />
        <aura:if isTrue="{! not( empty( v.recordId ) ) }">
             <lightning:recordEditForm 
                recordId="{!v.recordId}"
                objectApiName="Contact">
                <lightning:messages />
        <lightning:outputField fieldName="Account.Website" aura:id="awebsite"/>
            <lightning:outputField fieldName="Account.Name" aura:id="aname"/>
            <lightning:outputField fieldName="Account.Industry" aura:id="aindustry"/>
                 </lightning:recordViewForm>

it would be great if anyone could point me a right direction/documentation or link. thank you for your time.

1

According to documentation, Fields that have a spanning relationship aren't supported by lightning:outputField. The fields specified must be associated with only one object. A field such as Contact.Account.Ownership is a cross-object reference between the Contact object and the Account object, and can't be displayed in the form.

As a workaround, You can have nested recordEditForm, one on Contact and another one on account.

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.