You need to sign in to do that
Don't have an account?

Set Live Agent online automatically when starting console
I am trying to use the console integration kit to automatically set the user to online for Live Agent when they start the service cloud console. Below is my code for a footer component. It has two ways to set the agent status. The first is near the bottom of the script where the function to set online is automatically run when the page loads. The second is a link that the user can click.
There seems to be a timing problem. The function does run automatically, but it seems to run before the Live Agent component initializes. I am guessing that my function sets the agent online and then the Live Agent component resets to offline.
I think it is a timing problem because using the link after everything has started does sets the agent online.
Is there an event I can listen for or something else that allows my component to wait until everything is initialized?
There seems to be a timing problem. The function does run automatically, but it seems to run before the Live Agent component initializes. I am guessing that my function sets the agent online and then the Live Agent component resets to offline.
I think it is a timing problem because using the link after everything has started does sets the agent online.
Is there an event I can listen for or something else that allows my component to wait until everything is initialized?
<apex:page showHeader="false" sidebar="false"> <apex:includeScript value="/support/console/29.0/integration.js"/> <a href="#" onClick="fnSetAgentState('Online');return false;">Set Agent Status to Online</a> <script type="text/javascript"> function fnGetAgentState() { sforce.console.chat.getAgentState(function(result) { if (result.success) { alert('Agent State: ' + result.state); } else { alert('getAgentState has failed'); } }); } function fnSetAgentState(state) { sforce.console.chat.setAgentState(state, function(result) { if (result.success) { fnGetAgentState(); } else { alert('Live Agent: SetAgentState has failed'); } }); } fnSetAgentState('Online'); </script> </apex:page>
I know this is a tad old, but did you ever get this working? I'm looking for a way for Live Agent to default to online automatically.
Thanks