Skip to content

Instantly share code, notes, and snippets.

@simpluslabs
Created November 13, 2018 12:49
Show Gist options
  • Save simpluslabs/eba72b85ae3cac2b0f21dcae126e537a to your computer and use it in GitHub Desktop.
Save simpluslabs/eba72b85ae3cac2b0f21dcae126e537a to your computer and use it in GitHub Desktop.
<!--forceRecordDataComp-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
<aura:attribute name="recordError" type="String" access="private"/>
<force:recordData aura:id="recordHandler"
recordId="{!v.recordId}"
fields="Id"
targetError="{!v.recordError}"
recordUpdated="{!c.handleRecordUpdated}" />
<!-- Display the delete record form -->
<div class="Delete Record">
<lightning:card iconName="action:delete" title="Delete Record">
<div class="slds-p-horizontal--small">
<lightning:button label="Delete Record" variant="destructive" onclick="{!c.handleDeleteRecord}"/>
</div>
</lightning:card>
</div>
<!-- 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