declineAgentWork
エージェントに割り当てられた作業項目を却下します。API バージョン 32.0 以降で使用できます。
構文
1sforce.console.presence.declineAgentWork(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=""testDeclineWork('0Bzxx00000000001');return false;"">Decline Assigned Work Item</a>
20
21 <script type=""text/javascript"">
22 function testDeclineWork(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;
27 //Assume the work item has been assigned, but hasn’t yet been opened.
28 sforce.console.presence.declineAgentWork(id, function(result) {
29 if (result.success) {
30 alert('Declined work successfully');
31 } else {
32 alert('Decline work failed');
33 }
34 });
35 }
36 }
37 </script>
38</apex:page>"
39</apex:page>