declineAgentWork
エージェントに割り当てられた作業項目を却下します。API バージョン 32.0 以降で使用できます。
構文
1sforce.console.presence.declineAgentWork(workId:String, (optional) callback:function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| workId | String | エージェントが却下する作業項目の ID。 |
| declineReason | String | エージェントが作業要求を拒否した場合に入力された理由。 |
| callback | function | workId に関連付けられた作業項目をエージェントが却下するときにコールする JavaScript メソッド。 |
サンプルコード – Visualforce
1<apex:page >
2 <apex:includeScript value="/support/console/34.0/integration.js"/>
3 <a href="#" onClick="testAcceptWork();return false;">Accept Assigned Work Item</a>
4
5 <script type="text/javascript">
6 function testAcceptWork() {
7 //First get the ID of the assigned work item to accept it
8 sforce.console.presence.getAgentWorks(function(result) {
9 if (result.success) {
10 var works = JSON.parse(result.works);
11 var work = works[0];
12 if (!work.isEngaged) {
13 //Now that we have the assigned work item ID, we can accept it
14 sforce.console.presence.acceptAgentWork(work.workId, function(result) {
15 if (result.success) {
16 alert('Accepted work successfully');
17 } else {
18 alert('Accept work failed');
19 }
20 });
21 } else {
22 alert('The work item has already been accepted');
23 }
24 }
25 });
26 }
27 </script>
28</apex:page>