I have a Flow wrapped in a simple Lightning Component that I use to override the standard "New" button on accounts. I'm running into a couple of issues with the user experience.

  1. At the end of the Flow, I want the user to be redirected to the record they created (instead of looping back to the beginning of the flow). Or at the very least just close the window.

  2. How do I add an "X" or close button to the pop up window so the user can cancel out at any time?

I know you can use the URL redirect in a custom button, or use visualforce, but this is using the standard button AND no vf.

Here's my component:

<aura:component implements="lightning:actionOverride,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
        <aura:handler name="init" value="{!this}" action="{!c.init}" />
        <div aura:id="editDialog" role="dialog" tabindex="-1" aria-labelledby="header43" class="slds-modal slds-fade-in-open">
                    <div class="slds-modal__container">
                    <div class="slds-modal__header">
                        <h2 class="slds-text-heading--medium">New Record</h2>
                        <div class="slds-modal__content slds-p-around--large slds-grid slds-wrap ">
                        <lightning:flow aura:id="quickCreate" onstatuschange="{!c.handleStatusChange}" />
     <div aura:id="overlay" class="slds-backdrop slds-backdrop--open"></div>    

Here's my controller:

    init : function(component) {
        //Find the component whose aura:id is "quickCreate"
        var flow = component.find("quickCreate")
        //In that component, start your flow. Reference the flow's API Name
    handleStatusChange : function (component, event) {
        if(event.getParam("status") === "FINISHED") {
            var outputVariables = event.getParam("outputVariables");
            var outputVar;
            for(var i = 0; i < outputVariables.length; i++) {
                outputVar = outputVariables[i];
                if(outputVar.name === "redirect") {
                    var urlEvent = $A.get("e.force:navigateToSObject");
                        "recordId": outputVar.value,
                        "isredirect": "true"

Any help would be appreciated!

1 Answer 1


You can use the event e.force:closeQuickAction to close the popup.


Also, try if the redirect works after adding the above statement. If not, then might have to use window.location to force a redirect to the created record.

You must log in to answer this question.

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