How to handle a record save event in salesforce lightning?

I have implemented the record edit according to instructions given in Everything is working correctly except the recordSaveSuccess event and its handler.
Below I have included my code.{!} is not called. Am I doing something wrong?


<aura:iteration items="{!v.openActivityList}" var="activity">
    <tr onmouseenter="{!c.showEditIcon}" onmouseleave="{!c.hideEditIcon}"> 
            <c:DFActivityCardCmp activity="{!activity}" uiThemeDisplayed="{!v.uiThemeDisplayed}"/> 
        <td class="vertical-align-center iconDiv">
            <div class="slds-hide"> 
                <i aura:id="editIcon" data-id="{!activity.activityId}" class="fa fa-pencil" onclick="{!c.editActivity}"></i>

I have embedded the lightning component in Account page with a new tab.


<aura:handler name="onSaveSuccess" event="force:recordSaveSuccess" action="{!}"/> 

/Controller methods/

editActivity : function(component, event, helper) {/**Opens edit popup**/
    var recordId =; 
    var editRecordEvent = $A.get("e.force:editRecord");
        "recordId": recordId

save : function(component, event, helper) {/**handler method**/
    console.log("record saved");


force:recordSaveSuccess is used with the force:recordEdit component

<force:recordEdit aura:id="edit" recordId="{!v.recordId}" />

Source : Link , Question Author : nilesh_ramteke , Answer Author : vignesh

Leave a Comment