2

I have a Softphone Layout that needs to call a lightning component from a flow.

I wanted to call the lightning component from a Visualforce page so I could set the finish location.

When I try to test I get the error:

We can’t display component 'c:FMZ_LeadSearch', because it isn't supported in Classic runtime. Ask your Salesforce admin to distribute this flow in Lightning runtime instead.

This documentation states that I just need to Enable Lightning runtime for flows. Which I have done but am still not able to run the flow.

https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_admin_lexruntime.htm

There seems to be something going on with the Viualforce Page to Lightning Component display. What step am I missing? My lightning component has implements="force:appHostable, lightning:availableForFlowScreens, flexipage:availableForAllPageTypes"> and my VFP has

<apex:page standardController="Lead">
    <flow:interview name="Search_Create_Lead_Flow" finishLocation="{!URLFOR('/home/home.jsp')}"/>             
</apex:page>

3 Answers 3

3

You'll need to follow the steps from the Visualforce Developers Guide below.

  1. Create a Lightning app that declares a dependency on the lightning:flow component.
  2. Add the Lightning Components for Visualforce JavaScript library to your Visualforce page using the apex:includeLightning/ component.
  3. In the Visualforce page, reference the dependency app. (this one caught me. they named their app "lightningOutApp" and I didn't see that in the page code until I errored a lot).
  4. Write a JavaScript function that creates the component on the page using $Lightning.createComponent().

So once you have your lightning app and your flow, use the code from the article and replace the "lightningOutApp" text with your lightning app name. Then, replace the "myFlowName" with your flow name (and any input variables you may have). You should be good there but may need to incorporate lightningstylesheets=true. Not sure about that but I did and it works.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_lightningruntime.htm

2

if I'm not mistaken, the issue here is that you are trying to run this flow as a portion of a visual force page. If this is the case, then it will not work, as flows that are embedded in a visual force page will run using the classic runtime regardless of if lightning runtime for flows is enabled or not.

More information can be found below: https://help.salesforce.com/articleView?id=flow_distribute_runtime.htm&type=5

0

Enable lightning style sheets in the Visualforce page (and of course - launch from within Lightning).

Note the addition of lightningStylesheets="True" to first line of your example here:

<apex:page standardController="Lead" lightningStylesheets="True">
    <flow:interview name="Search_Create_Lead_Flow" finishLocation="{!URLFOR('/home/home.jsp')}"/>             
</apex:page>

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.