Skip to main content
aura.com

<aura:component implements="flexipage:availableForAllPageTypes,force:appHostable" access="global">

    <lightning:listView aura:id="listViewSuggestedCompanies"

    objectApiName="Coverage_Team__c"

    listName="My_Suggested_Companies"

    rows="5"

    showSearchBar="true"

    showActionBar="true"

    enableInlineEdit="true"

    showRowLevelActions="true"

    />

Need to add two buttons that launch a flow in modal dialog rather than in a new window/same window 

Shown Like below 

Launch a flow in a modal dialog from a List Button using Aura Component that renders ListView

On click should open

User-added image
1 respuesta
  1. 3 oct 2023, 18:53
    Hi Pooja,

    Try the below code, this might help you to run flow in a modal dialog.

    <aura:component>

    <aura:attribute name="{!isOpen}" type="Boolean" default="false" access="private"/>

    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <aura:if isTrue="{!v.isOpen}">

    <div style="height: 640px;">

    <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open">

    <div class="slds-modal__container">

    <header class="slds-modal__header slds-modal__header_empty">

    <lightning:buttonIcon iconName="utility:close" class="slds-modal__close" onclick="{!c.closeFlowModal}"/>

    </header>

    <div class="slds-modal__content slds-p-around_medium">

    <lightning:flow aura:id="flow" onstatuschange="{!c.closeModalOnFinish}" />

    </div>

    </div>

    </section>

    <div class="slds-backdrop slds-backdrop_open"></div>

    </div>

    </aura:if>

    </aura:component>

    Controller

     

    doInit : function(component, event, helper) {

    component.set('v.isOpen', true);

    var flow = component.find('flow');

    flow.startFlow('Flow_Name');

    },

    closeFlowModal : function(component, event, helper) {

    component.set("v.isOpen", false);

    },

    closeModalOnFinish : function(component, event, helper) {

    if(event.getParam('status') === "FINISHED") {

    component.set("v.isOpen", false);

    }

    }

    Please mark it as Best Answer if the above information was helpful.

    Thanks.

     
0/9000