getChatRequests()
エージェントに割り当てられたチャット要求のチャットキーを返します。API バージョン 29.0 以降で使用できます。
構文
1sforce.console.chat.getChatRequests(callback:Function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| callback | function | メソッドの完了時にコールされる JavaScript メソッド。 |
サンプルコード – Visualforce
1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<apex:page>
18 <apex:includeScript value="/support/console/29.0/integration.js"/>
19 <a href="#" onClick="testGetChatRequests();return false;">Get Chat Requests</a>
20
21 <script type="text/javascript">
22 function testGetChatRequests() {
23 sforce.console.chat.getChatRequests(function(result) {
24 if (result.success) {
25 alert('Number of Chat Requests ' + result.chatKey.length);
26 } else {
27 alert('getChatRequests has failed');
28 }
29 });
30 }
31 </script>
32</apex:page>