Lightning Experience の setSoftphonePanelHeight()
使用方法
ユーティリティバーのソフトフォンパネルの高さを設定します。高さはピクセル単位で指定する必要があります。このメソッドは API バージョン 38.0 以降で使用できます。
構文
1sforce.opencti.setSoftphonePanelHeight({
2 heightPX:height,
3 callback:function //Optional
4});引数
サンプルコード – HTML および JavaScript
1<html>
2 <head>
3 <script type="text/javascript" src="https://domain:port/support/api/41.0/lightning/opencti_min.js"></script>
4 <script type="text/javascript">
5 var callback = function(response) {
6 if (response.success) {
7 console.log('API method call executed successfully! returnValue:', response.returnValue);
8 } else {
9 console.error('Something went wrong! Errors:', response.errors);
10 }
11 };
12
13 function setSoftphonePanelHeight() {
14 sforce.opencti.setSoftphonePanelHeight({heightPX: 400, callback: callback});
15 }
16 </script>
17 </head>
18 <body>
19 <button onclick="setSoftphonePanelHeight();">setSoftphonePanelHeight()</button>
20 </body>
21</html>応答
このメソッドは非同期です。応答は、コールバックメソッドに渡されたオブジェクトで返されます。応答オブジェクトには次の項目が含まれます。
| 名前 | 型 | 説明 |
|---|---|---|
| success | boolean | API メソッドコールの呼び出しが成功した場合は true、それ以外の場合は false。 |
| returnValue | object | この API メソッドはこのオブジェクトを返しません。returnValue は常に null になります。 |
| errors | array | API コールが正常に行われた場合、この変数は null です。API コールが失敗した場合、この変数はエラーメッセージの配列を返します。 |