function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brittinie Harper 9Brittinie Harper 9 

Live Chat button not going live in communities

Seeking some assistance. I have moved forward with a button within my communities for live agent. The chat button is from the unmanaged package "Live Chat Button". All the configuration has been completed and it works as expected with the routing. However, the button is not going live unless the page is refreshed... I am unsure on why I need to refresh this page for it to go live. If anyone has any ideas on this please let me know! It is appreciated and thank you in advance.

 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Brittinle,
To Add Live Agent Chat Button in Communities.May I suggest you please refer the below link for reference. Hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
Brittinie Harper 9Brittinie Harper 9
Thank you Rahul!

I have already referred to those above links. The issue is still persisting. However, what I am seeing now is an error within our builder that is stating the following:

Error: 
Try refreshing the page. If that doesn't do the trick, give your Salesforce administrator the following error ID, and describe what you were trying to accomplish.
Error ID: 1069963840
This page has an error. You might just need to refresh it. Action failed: c:LiveAgentChatButton$controller$init [liveagent is not defined] Callback failed: aura://ComponentController/ACTION$getComponent Failing descriptor: {c:LiveAgentChatButton$controller$init}

I found the location of this error as a component in the unmanaged "Live Agent Chat Button".  (LiveAgentChatButtonController). I believe that within this code it is causing the error. However, I am unsure if this will assist with my button going "Live". Right now, a workaround of refreshing the page has been working for testing. However, we do not want to tell our external users to refresh a page to get live chat assistance. Let me know if this helps. 
({
    init : function(component, event, helper) {

        function liveAgentStart(){liveagent.setChatWindowHeight(500);
  liveagent.setChatWindowWidth(450); 
        
        
            //timeout to initiate liveAgent
            window.setTimeout(
                $A.getCallback(function() {
                    if (component.isValid()) {
                        var data = {};
                        data.LA_chatServerURL =component.get("v.endpoint");
                        data.LA_deploymentId =component.get("v.deploymentId");
                        data.organizationId =component.get("v.organizationId");
                        data.chatButtontId =component.get("v.chatButtontId");
                        data.userSessionData =component.get("v.userSessionData");
                        if (component.get("v.contact") != null){
                            data.contactId =component.get("v.contact").Id;
                            data.contactName =component.get("v.contact").Name;
                        }
                        function initLiveAgent (data){
                            var self = this;
                            self.data = data;

                            if ((typeof liveagent == "object") && (document.getElementById('btONline') != null )){
                                console.log('CTRL  init live agent');
                                clearInterval(interV);
                                helper.bindLiveAgent(component,data);
                            }else{
                                    console.log('CTRL  timeout to init live agent');
                            }
                        }
                        //setInterval to initiate liveAgent when liveagent object
                        // is available
                        interV = setInterval(initLiveAgent,500,data);
                    }else{
                    console.log('CTRL  component is not valid');
                }
                }), 100
            );
        }

        var isValid = helper.validateComponent(component);
        component.set("v.isInvalidInput", !isValid);
        if ( isValid){
            if ( component.get("v.userSessionData") == true){
                //retrieve logged user Contact Details
        		var action = component.get("c.getContact");
        		action.setCallback(this, function(a) {
                    component.set("v.contact", a.getReturnValue());
                    liveAgentStart();
        		});
        		$A.enqueueAction(action);
            }else {
                liveAgentStart();
            }

            var chatBtn = component.get("v.chatButtontId")+'';
            //adding liveAgent buttons wo global array
            if (!window._laq) { window._laq = []; }
            window._laq.push(function(){
                liveagent.showWhenOnline(
                    (function (chatBtn) {
                            return chatBtn;
                        })(chatBtn)
                    , document.getElementById('btONline'));
                liveagent.showWhenOffline(
                    (function (chatBtn) {
                            return chatBtn;
                        })(chatBtn)
                    , document.getElementById('btOFFline'));
            });
        }
    },

    startChat : function(component, event, helper) {
        liveagent.startChat(component.get("v.chatButtontId"));
    }
})

 
Aditya Talwar 14Aditya Talwar 14
Hi,
We are facing the same issue. Were you able to resolve the same?