I have implemented the record edit according to instructions given in https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_force_recordEdit.htm?search_text=channel. Everything is working correctly except the recordSaveSuccess event and its handler. Below I have included my code.{!c.save} 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="{!c.save}"/> 

/Controller methods/

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

save : function(component, event, helper) {/**handler method**/
    console.log("record saved");
  • Look this link to handle recordsaveSuccess developer.salesforce.com/docs/atlas.en-us.lightning.meta/… – vignesh Jan 24 '17 at 14:12
  • I tried this <aura:handler name="onSaveSuccess" event="force:recordSaveSuccess" action="{!c.save}" /> . But its not working. – nilesh_ramteke Jan 25 '17 at 5:01
  • please,Post your full code – vignesh Jan 25 '17 at 5:24
  • @vignesh Please check edits in the question. Tell me if you need more details. – nilesh_ramteke Jan 25 '17 at 5:39
  • what if the saveRecord throws an exception? how we can handle it on this component? – danigonlinea Aug 22 '18 at 14:27

force:recordSaveSuccess is used with the force:recordEdit component

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.