この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Lightning Experience の getSoftphoneLayout()

使用方法

現在のユーザのソフトフォンレイア��トを返します。このメソッドは API バージョン 38.0 以降で使用できます。

Open CTI for Lightning Experience メソッド screenPop() および searchAndScreenPop() では、screenPopSettings はサポートされていません。

メモ

構文

1sforce.opencti.getSoftphoneLayout({
2     callback: function
3});

引数

名前 説明
callback function API メソッドコールが完了するときに実行された JavaScript メソッド。

サンプルコード – HTML および JavaScript

1<html>
2<head>
3   <script type="text/javascript" src="https://domain:port/support/api/45.0/lightning/opencti_min.js"></script>
4   <script type="text/javascript">
5      var callback = function(response) {
6         if (response.success) {
7            alert(response.returnValue);
8         } else {
9            console.error(response.errors);
10            alert(
11               'Something went wrong. Please check error information in developer console.'
12            );
13         }
14      };
15
16      function getSoftphoneLayout() {
17         sforce.opencti.getSoftphoneLayout({
18            callback: callback
19         });
20      }
21   </script>
22</head>
23<body>
24   <button onclick="getSoftphoneLayout();">Get Softphone Layout</button>
25</body>
26</html>

応答

このメソッドは非同期です。応答は、コールバックメソッドに渡されたオブジェクトで返されます。応答オブジェクトには次の項目が含まれます。

名前 説明
success boolean API コールが正常に行われた場合、値 true が返されて returnValue でソフトフォンレイアウト定義が返され、それ以外の場合は false が返されます。
returnValue object API コールが正常に行われた場合、ソフトフォンレイアウト定義が返されます。API コールが失敗した場合、null が返されます。
返されたオブジェクトには、各通話種別を表す 3 つの要素が含まれます。
  • "Internal"
  • "Inbound"
  • "Outbound"
各通話種別には 3 つのサブセクションが含まれます。
  • "callRelatedFields" — 表示対象として選択された通話関連項目の配列。使用できる値は、"ANI""DNIS""SEGMENT""QUEUE" です。
  • "objects" — 表示対象として選択された Salesforce オブジェクトのセット。各オブジェクトから表示対象として選択された [項目表示ラベル] および [項目名] (API 参照名) も含まれます。
  • "screenPopSettings" — このオブジェクトには、"ExistingWindow" または "NewWindow" のいずれかの値を持つ "screenPopsOpenWithin" 項目が含まれます。
    また、各画面ポップの一致項目、"NoMatch""SingleMatch""MultipleMatches" の設定も含まれます。各一致項目には、対応する "screenPopType" 項目が格納されます。また、"screenPopData" 項目が格納される場合もあります。
    • "screenPopType""PopToEntity" の値が指定されている場合、"screenPopData" には対象オブジェクトの名前が含まれます。
    • "screenPopType""PopToVisualforce" の値が指定されている場合、"screenPopData" には対象 Visualforce ページの名前が含まれます。
    • "screenPopType""PopToSearch" の値が指定されている場合、"screenPopData" 項目は存在しません。
    • "screenPopType""PopToFlow" の値が指定されている場合、"screenPopData" には対象フローの名前が含まれます。
次に、returnValue の例を示します。
1{
2"Internal" : {
3   "callRelatedFields" : [
4    "ANI",  
5    "DNIS", 
6   ]
7   "objects" : {
8    "User" : [ {
9      "displayName" : "Name",
10      "apiName" : "Name"
11     }
12    ]
13   },
14   "screenPopSettings" : {}
15  },
16  "Inbound" : {
17   "callRelatedFields" : [
18    "ANI",
19    "DNIS",
20    "SEGMENT",
21    "QUEUE"  
22   ],
23    "objects" : {
24    "Account" : [ {
25      "displayName" : "Account Name",
26      "apiName" : "Name"
27     }
28    ]
29     
30   },
31   "screenPopSettings" : {
32    "NoMatch" : {
33     "screenPopType" : "PopToEntity",
34     "screenPopData" : "Contact"  
35    },
36     
37    "SingleMatch" : {
38     "screenPopType" : "PopToVisualforce",
39     "screenPopData" : "Visualforce_Page_Name"
40    },
41    "MultipleMatches" : {
42     "screenPopType" : "PopToSearch"
43    }
44   }
45  },
46  "Outbound" : {
47   "callRelatedFields" : [
48    "DNIS"  
49   ],
50   "objects" : {
51    "Account" : [ {
52      "displayName" : "Account Name",
53      "apiName" : "Name"
54     }
55    ]
56   },
57   "screenPopSettings" : {}
58  }
59 }
errors array API コールが正常に行われた場合、この変数は null になります。API コールが失敗した場合、この変数はエラーメッセージの配列を返します。