Close Quick Action

force:closeQuickAction

Closes a quick action panel. Only one quick action panel can be open in the app at a time.

For Use In

Lightning Experience, Salesforce Mobile App

To close a quick action panel, usually in response to completing or canceling the action, run $A.get("e.force:closeQuickAction").fire();.

This example closes the quick action panel after processing the input from the panel’s user interface and displaying a “toast” message with the processing results. While the processing and the toast are unrelated to closing the quick action, the sequence is important. Firing force:closeQuickAction should be the last thing your quick action handler does.

1/*quickAddController.js*/
2({
3  clickAdd: function (component, event, helper) {
4    // Get the values from the form
5    var n1 = component.find("num1").get("v.value");
6    var n2 = component.find("num2").get("v.value");
7
8    // Display the total in a "toast" status message
9    var resultsToast = $A.get("e.force:showToast");
10    resultsToast.setParams({
11      title: "Quick Add: " + n1 + " + " + n2,
12      message: "The total is: " + (n1 + n2) + ".",
13    });
14    resultsToast.fire();
15
16    // Close the action panel
17    var dismissActionPanel = $A.get("e.force:closeQuickAction");
18    dismissActionPanel.fire();
19  },
20});

This event is handled by the one.app container. It’s supported in Lightning Experience and the Salesforce mobile app only.

No specifications to show