1

We are working in lightning and created a flow to upload files. when we are calling the flow in visualforce page and using the page on a public website, its upload file functionality is not working on public website page. (we can select the file by clicking on upload files but upload functionality not working).Can anyone suggest me how to resolve it or is it a known issue?

enter image description here

Lightning App - AutomationPublicFormsCompApp.app

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

VF page

 <apex:page showHeader="false" sidebar="false">
  <head>
    <apex:includeLightning />
  </head>
  <body class="slds-scope">
    <div style="margin-left: 100px;margin-right: 280px;">
      <apex:image url="{!$Resource.Pre_employ_logo}" Style="width: 200px;"/>
      <div id="flowContainer" />
      <div id="lightning" />
      <div Style="width: 330px; margin-left: 315px; height: 60px;"><h1> © 2019 Pre-employ.com, Inc. All Rights Reserved.</h1></div>
    </div>
    <script type="text/javascript">
      var url = window.location.toString();
      var fields = url.split('=');
      var vTicketID = fields[1];
      if(vTicketID.includes('&')) {
        vTicketID = vTicketID.split('&');
        vTicketID = vTicketID[0];
      }
      var inputVariables = [
          { name : "varTicketID", type : "String", value: vTicketID }
      ];
      var statusChange = function (event) {
        if(event.getParam("status") == "FINISHED") {
          var outputVariables = event.getParam("outputVariables");
          var key;
          for(key in outputVariables) {
            if(outputVariables[key].name == "myOutput") {}
          }
        }
      };
      $Lightning.use("c:AutomationPublicFormsCompApp", function() {
        $Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange}, "flowContainer",
          function (component) {
            component.startFlow("Automation_Test_Flow_Public_Forms", inputVariables);
          }
        );
      });
    </script>
  </body>
</apex:page>

Successful upload message box which is not coming while adding the file from public site:

enter image description here

6
  • not working is not very descriptive, have you managed to pinpoint exactly what part of your code is not working? any debugging?
    – glls
    May 9, 2019 at 11:35
  • Actually, I am calling the visual flow "Automation_Test_Flow_Public_Forms" from lightning component and passing the parameter "inputVariables". At the time of running the flow independently it works fine but when we are calling the flow in the visualforce page and using the page on a public website, its upload file functionality is not working. I am adding the successful upload confirmation box at the end of the question.(which is not coming after selecting the file) May 9, 2019 at 12:23
  • You might wanna have a look at this salesforce.stackexchange.com/a/223570/19118 May 9, 2019 at 12:54
  • I thought that public pages were VF only....Where can I find documentation on how to use lightning? The sites gives me only VF pages to add. I have a feeling I am missing something. Any help would be appreciated. May 9, 2019 at 15:51
  • @disasterlooms If you look at this code, you'll notice this is actually a VF page that's dynamically generating Lightning components. In this line of code: $Lightning.use("c:AutomationPublicFormsCompApp", function() { /* ... */ }) May 9, 2019 at 16:40

0