7

I have a custom lightning component which pops up when I click on a quick action in a record detail page.

Once I click on a button in the popup, I want the popup to close and the parent detail page to refresh.

I use $A.get("e.force:closeQuickAction").fire() to close the popup. But I am not being able to refresh the parent detail page.

Is that possible?

  • please reach out to the CM Team to have your duplicate account merged. Thanks – glls Mar 30 '18 at 13:21
12

You can try force:refreshView, which reloads all data for the view. So in addition to $A.get("e.force:closeQuickAction").fire(); add $A.get('e.force:refreshView').fire(); in your setCallback method.

({
    handleClick : function(component, event, helper) {
        var saveLeadAction = component.get("c.leadSave");
        saveLeadAction.setCallback(this, function(a) {
            if (a.getState() === "SUCCESS") {
                $A.get("e.force:closeQuickAction").fire();
                $A.get('e.force:refreshView').fire();

            }else if (res.getState() === "ERROR") {
                console.log("Errore Saving Contact ");
            } 
        }); 
        $A.enqueueAction(saveLeadAction);
    }
})
| improve this answer | |
  • Thank You! I was trying to use refreshView before closeQuickAction (makes more sense to me - how can closed component fire another event?), but that did not work. – Jakub Mozucha Nov 6 '18 at 16:46
  • @saroj, Component is not refreshed with refreshView, seems like view is refreshed but component are not refreshed is there any workaround on this. – Sarvesh Apr 9 '19 at 8:21
  • @sarveshkumar What do you mean by component are not refreshed? – Saroj Bera Apr 9 '19 at 13:30

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.