0

I am trying to display both chat and flow in VF page

For the chat - I insert the embedded snap in and it works.

For the flow - I want it to look in the lightning UI, so I am opening it from lighting:out app.

The flow works good, but, The problem is that now when I click on the chat to start "chat with an agent" I get this error:

This page has an error. You might just need to refresh it. [NoErrorObjectAvailable] Script error.

QUESTION

Can I have both flow and chat on the same page with lighting enabled? what is the right way to do that?

This is my VF page code:

<apex:page showHeader="false" sidebar="false">

    <html>
        <head>
            <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
            <apex:includeLightning />
        </head>
        <body>
            <div id="flowContainer" />

            <script>

            $Lightning.use("c:SupportForm",                             // name of the Lightning app
                           function() {                                 // Callback once framework and app loaded
                               $Lightning.createComponent(
                                   "c:SupportForm_CaseFlow",            // top-level component of your app
                                   {}   ,                               // attributes to set on the component when created
                                   "flowContainer",                     // the DOM location to insert the component
                                   function(cmp) {
                                                                        // callback when component is created and active on the page
                                   }
                               );
                           }
                          );
            </script>

            <style type='text/css'>
                .embeddedServiceHelpButton .helpButton .uiButton {
                background-color: #005290;
                font-family: "Arial", sans-serif;
                }
                .embeddedServiceHelpButton .helpButton .uiButton:focus {
                outline: 1px solid #005290;
                }
            </style>

            <script type='text/javascript' src='https://service.force.com/embeddedservice/5.0/esw.min.js'></script>
            <script type='text/javascript'>
                var initESW = function(gslbBaseURL) {

                    embedded_svc.settings.displayHelpButton = true;
                    embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'

                    embedded_svc.settings.enabledFeatures = ['LiveAgent'];
                    embedded_svc.settings.entryFeature = 'LiveAgent';

                    embedded_svc.init(
                        'https://mydomain.cs34.my.salesforce.com',
                        'https://mydomain.cs34.force.com/',
                        gslbBaseURL,
                        'xxxxxxxx',
                        'chat_team',
                        {
                            baseLiveAgentContentURL: 'https://c.xxxxxx.salesforceliveagent.com/content',
                            deploymentId: 'xxxxxxxx',
                            buttonId: 'xxxxxxxx',
                            baseLiveAgentURL: 'https://d.xxxxxxxx.salesforceliveagent.com/chat',
                            eswLiveAgentDevName: 'chat_team',
                            isOfflineSupportEnabled: false
                        }
                    );
                };

            if (!window.embedded_svc) {
                var s = document.createElement('script');
                s.setAttribute('src', 'https://xxxxxxxx.cs34.my.salesforce.com/embeddedservice/5.0/esw.min.js');
                s.onload = function() {
                    initESW(null);
                };
                document.body.appendChild(s);
            } else {
                initESW('https://service.force.com');
            }
            </script>




        </body>
    </html>
</apex:page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.