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
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/29.0/integration.js"/>
19 <script type="text/javascript">
20
21 /* Note: Open CTI needs to set call type to before getting it, and call type is INTERNAL/INBOUND/OUTBOUND.
22 */
23
24 var callback2 = function (result) {
25 alert('Call attached data is ' + result.data + '\n Call Type is ' + result.type);
26
27 };
28
29 /* Retrieving call ID of first call that came in and
30 * calling getCallAttachedData() to retrieve call data.
31 */
32 var callback1 = function (result) {
33 if (result.ids && result.ids.length > 0) {
34 sforce.console.cti.getCallAttachedData(result.ids[0], callback2, {getCallType:true});
35 }
36 };
37
38 //Note that we are using the CTI submodule here
39 function testGetCallAttachedData() {
40 sforce.console.cti.getCallObjectIds(callback1);
41 };
42
43 </script>
44 <h1>CTI</h1>
45 <button onclick="testGetCallAttachedData()">getAttachedData</button>
46</apex:page>応答
このメソッドは非同期であるため、コールバックメソッドのオブジェクトで応答を返します。応答オブジェクトには次の項目が含まれます。
| 名前 | 型 | 説明 |
|---|---|---|
| data | string | JSON 形式のコールの添付データ。 |
| success | boolean | 添付データが正常に返された場合は true、添付データが正常に返されなかった場合は false。 |
| type | string | コールの種別。使用可能な値には、「INTERNAL」、「INBOUND」、「OUTBOUND」があります。 |