declineChat()
チャット要求を却下します。API バージョン 29.0 以降で使用できます。
構文
1sforce.console.chat.declineChat(chatKey:String, (optional)callback:Function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| chatKey | String | 却下する要求のチャットキー。 |
| 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="testDeclineChat();return false;">Decline Chat</a>
20
21 <script type="text/javascript">
22 function testDeclineChat() {
23 //Get the value for 'myChatKey'from the getChatRequests() or onChatRequested() methods.
24 //These values are for example purposes only
25 var chatKey = 'myChatKey';
26 sforce.console.chat.declineChat(chatKey, declineSuccess);
27 }
28
29
30 function declineSuccess(result) {
31 //Report whether declining the chat was succesful
32 if (result.success == true) {
33 alert('Declining the chat was successful');
34 } else {
35 alert('Declining the chat was not successful');
36 }
37 };
38 </script>
39</apex:page>