You need to sign in to do that
Don't have an account?
AliaBurdick
Flow file:upload component not working when called from VFP in Lightning
I have a flow called from a VFP that needs to utilize the Upload Files component in the flow. Since this component only works if the flow runs in Lightning Runtime, this has been enabled in our org. It turns out though, that any flow called from a VFP will by default render in Classic, EVEN IF Lightning Runtime is enabled.
I followed the directions in this document (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_lightningruntime.htm) to create a Lightning Component extending Lightning Out with a dependency on lighting:flow. Then I updated the VFP to call this component and launch the flow.
This did result in the flow seemingly to run in Lightning Runtime vs Classic (at least visually it did). Unfortunately, the upload file component still does not work, even with this solution in place.
Does anyone have any idea how I can get this file upload component to function to work when called from a VFP in Lightning Runtime? I'm stumped.
Code as its implemented now is below - I haven't set any of the finish behavior or outputs yet.
I followed the directions in this document (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_lightningruntime.htm) to create a Lightning Component extending Lightning Out with a dependency on lighting:flow. Then I updated the VFP to call this component and launch the flow.
This did result in the flow seemingly to run in Lightning Runtime vs Classic (at least visually it did). Unfortunately, the upload file component still does not work, even with this solution in place.
Does anyone have any idea how I can get this file upload component to function to work when called from a VFP in Lightning Runtime? I'm stumped.
Code as its implemented now is below - I haven't set any of the finish behavior or outputs yet.
<aura:application access="global" extends="ltng:outApp" > <aura:dependency resource="lightning:flow"/> </aura:application>
<apex:page standardController="Stipulations__c" recordSetVar="stipulations"> <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:LightningRuntime", function() { // Create the flow component and set the onstatuschange attribute $Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange}, "flowContainer", function (component) { // Set the input variables var inputVariables = [ { name : 'inputOpptyId', type : 'String', value : "{!$CurrentPage.parameters.Id}" } ]; // Start an interview in the flowContainer div, and // initializes the input variables. component.startFlow("Stipulations_Submit_Documentation", inputVariables); } ); }); </script> </body> </html> </apex:page>
My code differs from yours in that I removed the recordSetVar in the apex:page tag and removed the inputVariables in the component.startFlow (line 37). I'll need to put those back at some point.
Did you find the solution to this?I have the exact same as well!
Check the docuementaion here https://help.salesforce.com/s/articleView?id=sf.flow_ref_elements_screencmp_fileupload.htm&type=5