onChatRequested()
エージェントがチャット要求を受け取るとコールされる関数を登録します。API バージョン 29.0 以降で使用できます。
構文
1sforce.console.chat.onChatRequested(eventHandler:Function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| eventHandler | function | チャット要求がエージェントに割り当てられるとコールされる JavaScript メソッド。 |
サンプルコード – Visualforce
1<apex:page >
2 <apex:includeScript value="/support/console/29.0/integration.js"/>
3 <script type="text/javascript">
4 var eventHandler = function (result) {
5 alert('There is a new incoming chat request with this chatKey: ' + result.chatKey);
6 }
7 sforce.console.chat.onChatRequested(eventHandler);
8 </script>
9</apex:page>