login
エージェントが特定のプレゼンス状況でオムニチャネルにログインします。接続エラーの後にこのメソッドを使用して、オムニチャネルに再接続することもできます。API バージョン 32.0 以降で使用できます。
構文
1sforce.console.presence.login(statusId:String, (optional) callback:function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| statusId | String | プレゼンス状況の ID。関連するプロファイルまたは権限セットを使用して、このプレゼンス状況へのアクセス権をエージェントに付与する必要があります。 |
| callback | function | statusId に関連付けられたプレゼンス状況でエージェントがログインしたときにコールする JavaScript メソッド。 |
サンプルコード – Visualforce
1<apex:page>
2 <apex:includeScript value="/support/console/52.0/integration.js"/>
3 <a href="#" onClick="testLogin('0N5xx00000000081');return false;">Log In to Omni-Channel</a>
4
5 <script type="text/javascript">
6 function testLogin(statusId) {
7 //Gets the Salesforce ID of the presence status entity which the current user has been assigned through their permission set or profile.
8 //These values are for example purposes only.
9 sforce.console.presence.login(statusId, function(result) {
10 if (result.success) {
11 alert('Login successful');
12 } else {
13 alert('Login failed');
14 }
15 });
16 }
17 </script>
18</apex:page>