login
エージェントが特定のプレゼンス状況でオムニチャネルにログインします。API バージョン 32.0 以降で使用できます。
構文
1sforce.console.presence.login(statusId:String, (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="testLogin('0N5xx00000000081');return false;">Log In to Omni-Channel</a>
20
21 <script type="text/javascript">
22 function testLogin(statusId) {
23 //Gets the Salesforce ID of the presence status entity which the current user has been assigned through their permission set or profile.
24 //These values are for example purposes only.
25 sforce.console.presence.login(statusId, function(result) {
26 if (result.success) {
27 alert('Login successful');
28 } else {
29 alert('Login failed');
30 }
31 });
32 }
33 </script>
34</apex:page>