Created
November 17, 2016 09:14
-
-
Save pradeep-dani/8a260d6ec38033d0550bf893da59ae36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page sidebar="false" showHeader="false" standardStylesheets="false"> | |
<apex:includeScript value="/support/console/36.0/integration.js"/> | |
<script type="text/javascript"> | |
var __sfdcSessionId = '{!GETSESSIONID()}'; | |
</script> | |
<script src="../../soap/ajax/38.0/connection.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
var _laEventHandler = function (result) { | |
var _laStatusObj = new sforce.SObject("pradeep_dani__Live_Agent_Status__c"); | |
_laStatusObj.Name = result.state; | |
var _result = sforce.connection.create([_laStatusObj]); | |
if(_result && _result[0].getBoolean("success")){ | |
alert('Live_Agent_Status__c Record inserted successfully :' + _result[0] ); | |
} | |
else{ | |
alert('Error : '+_result); | |
} | |
}; | |
sforce.console.chat.onAgentStateChanged(_laEventHandler); | |
</script> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment