Created
November 13, 2018 11:32
-
-
Save simpluslabs/ecd0b31882e55cf4539b2ce5cc2212e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--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