Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!--forceRecordDataComp-->
<aura:component>
<aura:attribute name="recordId" type="String" default="0017F00000RxUwTQAV"/>
<aura:attribute name="record" type="Object"/>
<aura:attribute name="simpleRecord" type="Object"/>
<aura:attribute name="recordError" type="String"/>
<force:recordData aura:id="recordLoader"
recordId="{!v.recordId}"
targetFields="{!v.simpleRecord}"
targetError="{!v.recordError}"
recordUpdated="{!c.handleRecordUpdated}"
fields="BillingCity,BillingState,Name"
/>
<lightning:card iconName="standard:account" title="{!v.simpleRecord.Name}" >
<p>
<lightning:formattedText title="Billing City" value="{!v.simpleRecord.Name}" /></p>
<p>
<lightning:formattedText title="Billing City" value="{!v.simpleRecord.BillingCity}" /></p>
<p>
<lightning:formattedText title="Billing State" value="{!v.simpleRecord.BillingState}" /></p>
</lightning:card>
<!-- Display Lightning Data Service errors, if any -->
<aura:if isTrue="{!not(empty(v.recordError))}">
<div class="recordError">
{!v.recordError}</div>
</aura:if>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.