You need to sign in to do that
Don't have an account?
Gautam_Kasukhela
Lightning Data Service Data Load Account Data Issue
I am trying to load a lightning card with data from 4 fields of the Account object using "force:recordData" .
I see only one field's data i.e. of the 'Name' field. Following is a code of my component:-
I am using an Admin profile and I have validated that the fields have data and is accessible for this profile.
I see only one field's data i.e. of the 'Name' field. Following is a code of my component:-
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > <aura:attribute name ="record" type="Object" description="the record object to be displayed"/> <aura:attribute name="simpleRecord" type ="Object" description="simplified view record object to be displayed."/> <aura:attribute name="recordError" type="String" description="An error message bound to force:recordData"/> <force:recordData aura:id="record" layoutType="FULL" recordId="{!v.recordId}" targetError="{!v.recordError}" targetRecord="{!v.record}" targetFields ="{!v.simpleRecord}" mode="VIEW"/> <!-- Use the Lightning Data Service to populate the data--> <div class="Record Details"> <lightning:card iconName="standard:account" title="{!v.simpleRecord.Name}" > <div class="slds-p-horizontal--small"> <p class="slds-text-heading--small"> <lightning:formattedText title="Annual Revenue" value="{!v.simpleRecord.AnnualRevenue}" /></p> <p class="slds-text-heading--small"> <lightning:formattedText title="Number of Employees" value="{!v.simpleRecord.NumberOfEmployees}" /></p> <p class="slds-text-heading--small"> <lightning:formattedText title="Billing City" value="{!v.simpleRecord.BillingCity}" /></p> </div> </lightning:card> </div> <!-- Display Lightning Data Service errors, if any --> <aura:if isTrue="{!not(empty(v.recordError))}"> <div class="recordError"> {!v.recordError}</div> </aura:if> </aura:component>What am I missing here that is resulting in a page like the below:-
I am using an Admin profile and I have validated that the fields have data and is accessible for this profile.
All Answers