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?

1
  • please reach out to the CM Team to have your duplicate account merged. Thanks
    – glls
    Commented Mar 30, 2018 at 13:21

1 Answer 1

14

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);
    }
})
3
  • 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. Commented Nov 6, 2018 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
    Commented Apr 9, 2019 at 8:21
  • @sarveshkumar What do you mean by component are not refreshed?
    – Saroj Bera
    Commented Apr 9, 2019 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .