0 votes
1 view
in SAP by (7k points)

We have developed chatbot functionality for our on-premise ERP using Recast.AI.

Basically, we have deployed a plugin on the On-Premise Fiori launchpad using the following code; However the Fiori launchpad freezes after the chatbot launches and we cannot execute anything on the Fiori Launchpad. The options in SAP Note 2544600 haven't helped us. Any idea, what could be the issue?

Regards,

Karan

sap.ui.define([
"sap/ui/core/UIComponent",

], function (UIComponent) {
"use strict";


return UIComponent.extend("com.abc.chatbot.Component", {

    /**
     * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
     * @public
     * @override
     */
    init: function () {
        // call the base component's init function
        UIComponent.prototype.init.apply(this, arguments);
        var renderer = sap.ushell.Container.getRenderer("fiori2");
        if (!document.getElementById("recast-webchat")) {


            var s = document.createElement("script");
            s.setAttribute("id", "recast-webchat");
            s.setAttribute("src", "https://cdn.recast.ai/webchat/webchat.js");
            //document.body.appendChild(s);
            if (document.body != null) {
                document.body.appendChild(s);
            }
        }
        s.setAttribute("channelId", "abc");
        s.setAttribute("token", "xyz");
    }
});

The issue is with appendChild; which makes the launchpad unresponsive. Not sure what could be the alternative as I have tried various ways such as creating div, fragments as well.

1 Answer

0 votes
by (14.5k points)
The issue that you are facing is related to the webchat.

In a recent update, this particular issue in the Fiori configuration has been fixed.

So, do not worry. The code would work now!

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...