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"/>
<!--Save data in force record start-->
<force:recordData aura:id="recordSaver"
recordId="{!v.recordId}"
targetFields="{!v.simpleRecord}"
targetError="{!v.recordError}"
recordUpdated="{!c.handleRecordUpdated1}"
layoutType="FULL"
mode="EDIT"
/>
<div>
<lightning:card iconName="action:edit" title="Edit Account">
<div>
<lightning:input label="Account Name" value="{!v.simpleRecord.Name}"/>
<br/>
<lightning:button label="Save Account" variant="brand" onclick="{!c.handleSaveRecord}" />
</div>
</lightning:card>
</div>
<!--Save data in force record end-->
<!-- 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.