Newer Version Available
setCallAttachedData()
Sets the call data associated with a call object
ID. Use to get information or send information between an interaction
log and a custom console component.This method is only available in API version 31.0 or
later.
Syntax
1sforce.console.cti.setCallAttachedData( callObjectId:String, callData:JSON string callType:String, (optional)callback:Functional)Arguments
| Name | Type | Description |
|---|---|---|
| callObjectId | string | The object ID of the call. |
| callData | string | JSON string that specifies the data to attach to the call. |
| callType | string | String that specifies the call type, such as internal, inbound, or outbound. |
| callback | function | JavaScript method called upon completion of the method. |
Sample Code–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 <A HREF="#" onClick="testSetCallAttachedData();return false">
19 Click here to set call attached data </A>
20
21 <apex:includeScript value="/support/console/31.0/integration.js"/>
22 <script type="text/javascript">
23
24 function testSetCallAttachedData() {
25 //callData must be a JSON string. We assume that your browser has
26 //access to a JSON library.
27 var callData = JSON.stringify({"ANI":"4155551212", "DNIS":"8005551212"});
28
29 //Set the call attached data associated to call id 'call.1'
30 sforce.console.cti.setCallAttachedData('call.1', callData, 'outbound');
31 }
32 </script>
33</apex:page>Response
This method is asynchronous, so it returns its response in an object in a callback method. The response object contains the following field:
| Name | Type | Description |
|---|---|---|
| success | boolean | true if the event firing was successful; false otherwise. |