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

closeAgentWork

作業項目の状況を「完了」に変更し、オムニチャネルウィジェットの作業項目リストから削除します。API バージョン 32.0 以降で使用できます。

構文

1sforce.console.presence.closeAgentWork(workId:String, (optional) callback:function)

引数

名前 説明
workId String 完了した作業項目の ID。
callback function workId に関連付けられた作業項目が完了したときにコールする 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/32.0/integration.js""/>
19    <a href=""#"" onClick=""testCloseWork('0Bzxx00000000001');return false;"">Close Open Work Items</a> 
20
21    <script type=""text/javascript"">
22        function testCloseWork(workId) {
23            //These values are for example purposes only.
24            sforce.console.presence.getAgentWorks(function(result) { 
25            if (result.success) { 
26                var id = result.works[0].workId; //assume work is assigned and opened
27                sforce.console.presence.closeAgentWork(id, function(result) { 
28                    if (result.success) { 
29                        alert('Closed work successfully');
30                    } else {
31                        alert('Close work failed');
32                    }
33                });
34            }
35        }
36    </script>
37</apex:page>"

応答

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

名前 説明
success Boolean 作業項目が正常に完了した場合は true、作業項目が正常に完了しなかった場合は false