Rohan Thakur
Rohan Thakur

Reputation: 1

Screen Flow Error on an External Web Application

I am embedding a Salesforce screen flow in my web application using Lighting Out feature. It worked for very basic screen flow with 2 screens but when I used a complex screen flow it is showing me following error:

Screen Flow Error: This page has an error. You might just need to refresh it. Error during LWC component connect phase: [Error in $A.getCallback() [Cannot read properties of null (reading 'getReference')]] Failing descriptor: {markup://flowruntime:auraField}

I am facing above error while running web application, I can see the flow button but fields are not showing because of above error.

-- Aura Component --


<!-- auraScreenFlow.cmp -->

<aura:component>
    <aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowScreen" />
</aura:component>

<!-- auraScreenFlowController.js -->

({
    init : function(component) {
        var flow = component.find("flowScreen");
        flow.startFlow("flow_api_name");
    }
})

-- Lightning Application --


<!-- auraScreenFlowApplication.app -->

<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
    <aura:dependency resource="c:auraScreenFlow" />
</aura:application>

-- Web Application HTML --


<!-- index.html -->

<div id="flow"></div>

<script src="https://myorg.lightning.force.com/lightning/lightning.out.js"></script>
<script>
    $Lightning.use('c:auraScreenFlowApplication',
            function () {
                $Lightning.createComponent(
                    'c:auraScreenFlow',
                    {},
                    "flow",
                    function (cmp) {
                        console.log('Created', { cmp });
                    }
                );
            },
            'https://myorg.lightning.force.com/',
            'access-token'
        );
</script>

I configured Lightning Out feature properly. Created a Connected App, Saved https://localhost:8081 in CORS setting of my Org, and my web app is running fine. But after loading of Lightning App, Screen Flow only shows button not fields that are in flow.

I searched for solution applied some solutions and still facing same issue.

Please, tell me why I'm facing this problem and How I can fix it?

Thanks.

Upvotes: 0

Views: 657

Answers (0)

Related Questions