July 2018
Beginner to intermediate
458 pages
9h 58m
English
The force:recordData component also provides a delete function, for the ability to delete records. Note that you will need to have recordId populated in order to delete the record.
The component code is as follows:
<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 Lightning Data Service errors, if any --> <aura:if isTrue="{!not(empty(v.recordError))}"> <div class="recordError"> <ui:message title="Error" severity="error" closable="true"> {!v.recordError} </ui:message> ...Read now
Unlock full access