You need to sign in to do that
Don't have an account?
SFDC_Saurabh
force:recordData not loading record
Hello,
I have below lightning markup which should display value of a record from LDS.
Boat details are here for {!v.boatId}
But the <force:recordData> does not display the below line.
{!v.record.Name} should come
However in same code if I hardcode the Id of object record as below, it works.
recordId="a061H00000aQlGsQAK"
I have below lightning markup which should display value of a record from LDS.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global"> <aura:attribute name="boatId" type="ID" access="public"/> <aura:attribute name="record" type="Boat__c" description="The record object to be displayed" access="public"/> <aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed" access="public"/> <aura:attribute name="recordError" type="String" description="An error message bound to force:recordData" access="public"/> Boat details are here for {!v.boatId} <force:recordData aura:id="service" recordId="{!v.boatId}" fields="Id,Name" mode="VIEW" targetFields="{!v.record}" targetError="{!v.recordError}" /> <br/>{!v.record.Name} should come </aura:component>In above code the below line properly displays the id of object.
Boat details are here for {!v.boatId}
But the <force:recordData> does not display the below line.
{!v.record.Name} should come
However in same code if I hardcode the Id of object record as below, it works.
recordId="a061H00000aQlGsQAK"
All Answers
This always returns TRUE for v.accountRecord.action_required__c. Even if the checkbox field is not set!
If I substitute {!job.Id} with the actual recordId string, it returns the correct boolean.
What is going on?
I was using the force:recordData within a aura:iteration component, which doesnt seem to work, and also has some serious performance issues apparently: https://salesforce.stackexchange.com/questions/224837/is-it-prudent-to-use-forcerecorddata-and-similar-within-auraiteration
I'll probably try an Apex class to read out the needed fields.