0

LightningRecordFormExample.cmp: (Api version: 45.0)

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global">

    <aura:attribute name="fieldsList" type="List" default="[Name,Phone,Industry]" />

    <lightning:card title="Edit Account" iconName="standard:account">
        <lightning:recordForm   recordId="0013700000Y1ABaAAN"
                                objectApiName="Account"
                                mode="view"
                                columns="2"
                                fields="{!v.fieldsList}"
                                onload="{!c.handleOnLoad}" />           
    </lightning:card>

</aura:component>

I dropped this component on Account page layout above the standard Record Detail component.We can see that standard record detail component displays Name and Industry fields but the custom component I created with lightning:recordForm is not showing.

enter image description here

3
  • if you add a layouttype does it change anything (i know its supposed to be optional)?
    – glls
    Commented Apr 8, 2019 at 2:12
  • @glls adding layoutType = "Full" showing all fields including Name and Industry fields.
    – javanoob
    Commented Apr 8, 2019 at 2:15
  • thats odd =/ , i would have expected them to show up as well initially
    – glls
    Commented Apr 8, 2019 at 2:21

1 Answer 1

0

Changed the below line

<aura:attribute name="fieldsList" type="List" default="[Name,Phone,Industry]" />

to

<aura:attribute name="fieldsList" type="List" default="['Name','Phone','Industry']" /> and it works fine now.

You must log in to answer this question.

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