この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

cancelFileTransferByAgent()

ファイル転送要求がエージェントによってキャンセルされたことを示します。API バージョン 31.0 以降で使用できます。

構文

1sforce.console.chat.cancelFileTransferByAgent(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/31.0/integration.js"/>
19    <a href="#" onClick="testCancelFileTransfer();return false;">Cancel file transfer</a> 
20
21    <script type="text/javascript">
22        function testCancelFileTransfer() {
23            //Gets the value for 'myChatKey'from the getChatRequests() or onChatRequested()
24              methods. 
25            //These values are for example purposes only.
26            var chatKey = 'myChatKey'; 
27            sforce.console.chat.cancelFileTransferByAgent(chatKey, fileSuccess);
28        }
29        
30        function fileSuccess(result) {
31            //Report whether canceling was successful
32            if (result.success == true) {
33                alert('Canceling file transfer was successful.');
34            } else {
35                alert('Canceling file transfer was not successful.');
36            }
37        };
38    </script>
39</apex:page>

応答

このメソッドは非同期であるため、コールバックメソッドのオブジェクトで応答を返します。応答オブジェクトには次のプロパティが含まれます。

名前 説明
success Boolean ファイル転送要求が正常にキャンセルされた場合は true、ファイル転送要求が正常にキャンセルされなかった場合は false