You need to sign in to do that
Don't have an account?

Loading a Record using force.recordData targetFields
I'm having difficulty using force:recordData to load some data for a record in a Lightning component.
In the above, the data does not render on the page; if I try to specifically set the fields in force:recordData, it doesn't help either. Is there something I'm missing on this?
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> <aura:attribute name="record" type="Object"/> <aura:attribute name="fieldsToQuery" type="Object"/> <aura:attribute name="recordError" type="String"/> <force:recordData aura:id="recordLoader" recordId="{!v.recordId}" layoutType="FULL" targetRecord="{!v.record}" targetError="{!v.recordError}" targetFields="{!v.fieldsToQuery}" /> {!v.fieldsToQuery.Name} <br/> {!v.fieldsToQuery.MailingAddress}<br /> {!v.fieldsToQuery.MailingCity}, {!v.fieldsToQuery.MailingState} {!v.fieldsToQuery.MailingPostalCode}<br /> {!v.fieldsToQuery.MailingCountry} </aura>
In the above, the data does not render on the page; if I try to specifically set the fields in force:recordData, it doesn't help either. Is there something I'm missing on this?
steps to check this lightning component : [result only showing when we add this component to object(contact) detail page]
In lightning experience >> open any of contact record detail page and from top settings icon select edit page
drag your lightning component on detail page
save and active your page and see the output on your contact detail page
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others ,thanks
http://sfdcmonkey.com (http://sfdcmonkey.com )
All Answers
steps to check this lightning component : [result only showing when we add this component to object(contact) detail page]
In lightning experience >> open any of contact record detail page and from top settings icon select edit page
drag your lightning component on detail page
save and active your page and see the output on your contact detail page
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others ,thanks
http://sfdcmonkey.com (http://sfdcmonkey.com )