Skip to main content

#Lightning Aura Component #Javascript

I have tried going on the LWC route but there is no functionality like overlay library.

I have solved this issue using $A.createcomponent. But I am facing a bug **while clicking the button for the second time**.

 

I am calling this inside the aura component I have put inside the Utility bar window.

 

<lightning:overlayLibrary aura:id="overlayLib"/>

There is a button inside utility window that triggers this js function:

 

openFlowOverlay: function (component, event, helper) {

$A.createComponent(

"lightning:flow",

{

"aura:id": "dynamicFlow",

},

function (newFlow, status, errorMessage) {

var overlayLib = component.find("overlayLib");

var flowName = "ABC_FLOW";

var flow = component.find("dynamicFlow");

if (status === "SUCCESS") {

var flowConfig = {

header: "ABC FLOW",

body: newFlow,

showCloseButton: true,

cssClass: "slds-modal_large",

closeCallback: function () {

}

};

overlayLib.showCustomModal(flowConfig)

.then(function(){

flow.startFlow(flowName);

});

} else {

console.error("Error creating Flow component: " + errorMessage);

}

}

);

}

 

When I open the utility bar and open it and click the button it's running fine. But when I close and try to click the button again I get this error.

 

So basically the component cannot find the flow in the DOM when it is running for# the second time.

 

Starting a screen flow inside an overlay modal that I am calling from utility bar using Aura

1 answer
  1. Sep 21, 2023, 11:09 PM

    What’s the reason you’re not using the standard utility bar flow functionality?

0/9000