0

I have embed a flow in aura component. This is my component class:

<aura:component implements="forceCommunity:availableForAllPageTypes, 
lightning:availableForFlowScreens" access="global">
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}" />

</aura:component>

This is my controller class:

({

  init : function(component, event, helper) {

    var flow= component.find("flowData");
    flow.startFlow("flowName");


},



 handleStatusChange : function (component, event) {
 if(event.getParam("status") === "FINISHED") {

        var urlEvent = $A.get("e.force:NavigateToURL");
        urlEvent.setParams({
           "url": "https://xyz.com/s/",
           "isredirect": "true"
        });
        urlEvent.fire();

       }
   },

})

When I run the flow and hit finish button, it just gets stuck there and keeps loading .... .

2
  • Can you check your url as there is extra '/' before https:// ? are you getting any error in browser console ? – Debadyuti Sil Feb 19 '20 at 20:09
  • Thanks for the help. Yes tried it, didn't work. – Anonymous Feb 19 '20 at 23:06
0

Could you please correct the handleStatusChange with following code. :

 handleStatusChange : function (component, event, helper) {
 if(event.getParam("status") === "FINISHED") {

        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
           "url": "https://xyz.com/s/",
           "isredirect": "true"
        });
        urlEvent.fire();

       }
   },
2
  • Thanks. I tried it, no change :( – Anonymous Feb 21 '20 at 0:29
  • This worked for me with a flow that I created . I added the helper and updated method name navigateToURL instead of NavigateToURL .if you can share more details about your flow I can try replicating that . – Debadyuti Sil Feb 21 '20 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.