You need to sign in to do that
Don't have an account?
Bob Poliquin 9
Flow wrapped in a lightning component using e.force:closeQuickAction
I have a flow wrapped in a lightning component for a global action.
The flow worked fine in the lightning component but the problem is the flow will run then go back to the start. I want the screen to disppear after the user clicks finish.
hen I added the e.force:closeQuickAction and click the global action the flow screen doesn't really open, but you can see it automatically close to the lower right hand corner of the computer screen. I'm not sure if I need to add something to my code below to only close the screen after the flow finishes but I'm not sure where the issue is with my code.
The flow worked fine in the lightning component but the problem is the flow will run then go back to the start. I want the screen to disppear after the user clicks finish.
hen I added the e.force:closeQuickAction and click the global action the flow screen doesn't really open, but you can see it automatically close to the lower right hand corner of the computer screen. I'm not sure if I need to add something to my code below to only close the screen after the flow finishes but I'm not sure where the issue is with my code.
<aura:component implements="force:appHostable, flexipage:availableForAllPageTypes, flexipage:availableForRecordHome,force:lightningQuickAction" > <aura:handler name="init" value="{!this}" action="{!c.init}" /> <lightning:flow aura:id="flowData" /> <br/> </aura:component>
({ init : function (component) { // Find the component whose aura:id is "flowData" var flow = component.find("flowData"); // In that component, start your flow. Reference the flow’s Unique Name. flow.startFlow("New_IT_Support_Case"); // Close the action panel var dismissActionPanel = $A.get("e.force:closeQuickAction"); dismissActionPanel.fire(); }, })
All Answers
did you have a look here :
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_flow_onfinish.htm ?
Phil
thanks for your help.
I added the code to the link you provider but the flow screen still goes back to the beginning.
Here is my updated code
And then I tried this and the screen just pops up and goes away before i do anything.
consider removing it.
explanation : action="{!c.init} means that on initialization of your component it calls the init function in the controller ( -> c.init )
but you don't have it ;-)
Phil
I updated my code to this below and the error goes away but I get a blank flowscreen
Screenshot of result
Consider this way :
Hope this will work for you.
Phil
thank you for the above ,i received the following error when i tried to save the updates code.
Thank you I was able to save the updated component but I am receiving the following error whgen i try to create the IT case
Uncaught Action failed: c:CreateNewCase$controller$handleStatusChange [Cannot read property 'length' of undefined]
Callback failed: serviceComponent://ui.interaction.runtime.components.controllers.FlowRuntimeController/ACTION$executeAction
I adjust my flow to create a new IT case and I was able to get rid of the error and the code you provided does work where a case is created and a redirects to the newly created case with no other screen works when i add the lightning component to my lightning home page layout.
But, It is very odd when executing the same flow from a Global Action menu it still works but there is a Finish button at the end of the flow and then it returns back to the beginning of the flow. See Screen shots below.
I don't know if there is something else I can add to change the behavior in the lightning component global action button to perform like it does on the home page or outside of the global action button.
End of Flow
Beginning of Flow
Hi Phillippe,
Just circling back to this post, Thank you for helping me. I am marking your post as best anwser, but i wanted to share the updated code that resolves my requirements with the following code.