getCallAttachedData()
通話オブジェクト ID、または有効な通話がない場合は null によって表される通話の添付データを返します。このデータは、JSON 形式で返されます。このメソッドは、コンピューターテレフォニーインテグレーション (CTI) 用です。これは、API バージョン 24.0 以降でのみ使用できます。
構文
1sforce.console.cti.getCallAttachedData( callObjectId, getCallType, (optional) callback:Function )引数
| 名前 | 型 | 説明 |
|---|---|---|
| callObjectId | string | 添付データを取得する通話の通話オブジェクト ID。 |
| getCallType | boolean | 通話の種別が「INTERNAL」、「INBOUND」、「OUTBOUND」のいずれかで返された場合は true、それ以外の場合は false。この項目は、API バージョン 29.0 以降でのみ使用できます。 |
| callback | function | メソッドの完了時にコールされる JavaScript メソッド。 |
サンプルコード – Visualforce
1<apex:page>
2 <apex:includeScript value="/support/console/60.0/integration.js"/>
3 <script type="text/javascript">
4
5 /* Note: Open CTI needs to set call type to before getting it, and call type is INTERNAL/INBOUND/OUTBOUND.
6 */
7
8 var callback2 = function (result) {
9 alert('Call attached data is ' + result.data + '\n Call Type is ' + result.type);
10
11 };
12
13 /* Retrieving call ID of first call that came in and
14 * calling getCallAttachedData() to retrieve call data.
15 */
16 var callback1 = function (result) {
17 if (result.ids && result.ids.length > 0) {
18 sforce.console.cti.getCallAttachedData(result.ids[0], callback2, {getCallType:true});
19 }
20 };
21
22 //Note that we are using the CTI submodule here
23 function testGetCallAttachedData() {
24 sforce.console.cti.getCallObjectIds(callback1);
25 };
26
27 </script>
28 <h1>CTI</h1>
29 <button onclick="testGetCallAttachedData()">getAttachedData</button>
30</apex:page>応答
このメソッドは非同期であるため、コールバックメソッドのオブジェクトで応答を返します。応答オブジェクトには次の項目が含まれます。
| 名前 | 型 | 説明 |
|---|---|---|
| data | string | JSON 形式のコールの添付データ。 |
| success | boolean | 添付データが正常に返された場合は true、添付データが正常に返されなかった場合は false。 |
| type | string | 通話の種別。可能な値には、「INTERNAL」、「INBOUND」、「OUTBOUND」があります。 |