function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Parth ThakkarParth Thakkar 

Lightning out App error in callback function

Trying to replicate this https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_lightningruntime.htm
 but getting error here is my code. 

App:
<aura:application access="global"  extends="ltng:outApp" implements="ltng:allowGuestAccess">
	<aura:dependency resource="lightning:flow"/>
</aura:application>
VF Page: 
<apex:page >
   <html>
      <head>
         <apex:includeLightning />
      </head>
      <body class="slds-scope">
          
         <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
                     }
                  }
               }
            };
            $Lightning.use("c:FlowVFPage", function() {
               // Create the flow component and set the onstatuschange attribute
               $Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange},
                  "flowContainer",
                  function (component) {
                     // Set the input variables
                      
                     
                     // Start an interview in the flowContainer div, and 
                     // initializes the input variables.
                     component.startFlow("New_Customer", inputVariables);
                  }
               );
            });
         </script>
      </body>
   </html>
</apex:page>

How to solve this error? thanks in Advance. 


 
Best Answer chosen by Parth Thakkar
Alain CabonAlain Cabon
@Parth Thakkar

Did you try to start the flow without any inputVariables? 

component.startFlow("New_Customer");

What is the error?

All Answers

Alain CabonAlain Cabon
@Parth Thakkar

Did you try to start the flow without any inputVariables? 

component.startFlow("New_Customer");

What is the error?
This was selected as the best answer
Parth ThakkarParth Thakkar
@Alain Cabon 

Yes,  I already tried without input but still getting issue. 
Parth ThakkarParth Thakkar
I got it forgot to remove inputVariables  from  below line. 
 component.startFlow("New_Customer");