0

I've a login flow which uses flow and lightning component to present few screens. Issue with flow screens is these screens are not wide enough. I tried to use login flow with VF to get better control on UI. I'm creating lightning:flow component in lightning out script but its not working. When I preview the same VF from dev console, it works fine. VF with lightning out is used to get lightning runtime experience for flow. Otherwise, it can render flow but in old classic experience. VF Page:

<html>
  <head>
     <apex:includeLightning />

  </head>
  <body class="slds-scope">
      Text Message
     <div id="flowContainer" />
     <script>
        var statusChange = function (event) {
           if(event.getParam("status") === "FINISHED") {
              // Control what happens when the interview finishes

              var outputVariables = event.getParam("outputVariables");
              var key;
              for(key in outputVariables) {
                 if(outputVariables[key].name === "myOutput") {
                    // Do something with an output variable
                 }
              }
           }
        };
        console.log('right before calling use function');
        $Lightning.use("c:lightningOutApp", function() {
           console.log('in the callback of use function');
           // Create the flow component and set the onstatuschange attribute
           $Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange},
              "flowContainer",
              function (component) {

                 // Start an interview in the flowContainer div, and 
                 // initializes the input variables.
                 component.startFlow("User_Provisioning_Flow");
              }
           );
        });
     </script>
  </body>

Lightning App:

<aura:application access="global" extends="ltng:outApp">
   <aura:dependency resource="lightning:flow"/> 
</aura:application>

Error coming in console:

enter image description here

I'm not able to understand the error but this is causing the issue. I don't get this error if page previewed from developer console. My assumption is that due to restricted session in login flow, this is happening. If this is right then is there any way to increase the width of login flow screens which are rendered by flow screen components.

Your Answer

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

Browse other questions tagged or ask your own question.