setServicePresenceStatus
エージェントのプレゼンス状況を特定の ID を持つ状況に設定します。API バージョン 32.0 以降で使用できます。
構文
1sforce.console.presence.setServicePresenceStatus(statusId:String,
2 (optional) callback:function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| statusId | String | エージェントに設定するプレゼンス状況の ID。関連するプロファイルまたは権限セットを使用して、このプレゼンス状況へのアクセス権をエージェントに付与する必要があります。 |
| callback | function | statusId に関連付けられたプレゼンス状況にエージェントの状況を変更したときにコールする 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="testSetStatus('0N5xx00000000081');return false;">Set Presence Status</a>
20
21 <script type="text/javascript">
22 function testSetStatus(statusId) {
23 //Gets the Salesforce Id of the presence status that’s assigned to the current user through permission set or profile.
24 //These values are for example purposes only
25 sforce.console.presence.setServicePresenceStatus(statusId, function(result) {
26 if (result.success) {
27 alert('Set status successful');
28 alert('Current statusId is: ' + result.statusId);
29 alert('Channel list attached to this status is: ' + result.channels); //printout in console for lists
30 } else {
31 alert('Set status failed');
32 }
33 });
34 }
35 </script>
36</apex:page>