[SalesForce] Confusion on Lightning runtime requirements for component visibility conditions on screen flows

From how I understand the process, in order to use component visibility conditions on screen components, I need to run my flow using Lightning runtime. So currently my Process Automation Settings are set so that "Enable Lightning runtime for flows" is true, but I'm still getting hit with the error:

We can't display the field, because it uses conditional field visibility rules, which aren't supported in Classic runtime. Ask your Salesforce admin to distribute this flow in Lightning runtime instead.

My process is set up so that on a custom action click on the opportunity:

  1. A visualforce page is called that initiates a Screen Flow and populates a variable within the Screen Flow before starting:
<apex:page standardController="Opportunity" lightningStyleSheets="true">
    <apex:includeLightning/>
    <flow:interview name="Screen_Flow_Name">
        <apex:param name="recordId" value="{!opportunity.Id}"/>
    </flow:interview>
</apex:page>

I included lightningStyleSheets="true" and <apex:includeLightning/> to try to fix the issue but that hasn't caused the error above to go away.

  1. My flow then calls my Apex class that is pulling in variables from the flow to use.

However, I'm still perplexed about why checking that box isn't allowing me to use the custom visibilities rules in my screen flow. Any insight on this and subsequent help would be much appreciated! Thanks!

Best Answer

The "Lightning StyleSheets" attribute only adds the look of Lightning, but does not actually contain the full runtime. You need to expose the flow in a Lightning App or Lightning Component. Use lightning:flow to expose a flow in a compatible experience.

Related Topic