declineChat()
チャット要求を却下します。API バージョン 29.0 以降で使用できます。このメソッドは API バージョン 37.0 以降のオムニチャネルではサポートされていません。
構文
1sforce.console.chat.declineChat(chatKey:String, (optional)callback:Function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| chatKey | String | 却下する要求のチャットキー。 |
| callback | function | メソッドの完了時にコールされる JavaScript メソッド。 |
サンプルコード – Visualforce
1<apex:page>
2 <apex:includeScript value="/support/console/29.0/integration.js"/>
3 <a href="#" onClick="testDeclineChat();return false;">Decline Chat</a>
4
5 <script type="text/javascript">
6 function testDeclineChat() {
7 //Get the value for 'myChatKey'from the getChatRequests() or onChatRequested() methods.
8 //These values are for example purposes only
9 var chatKey = 'myChatKey';
10 sforce.console.chat.declineChat(chatKey, declineSuccess);
11 }
12
13
14 function declineSuccess(result) {
15 //Report whether declining the chat was succesful
16 if (result.success == true) {
17 alert('Declining the chat was successful');
18 } else {
19 alert('Declining the chat was not successful');
20 }
21 };
22 </script>
23</apex:page>