Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
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
1<apex:page>
2 <A HREF="#" onClick="testSetCallAttachedData();return false">
3 Click here to set call attached data </A>
4
5 <apex:includeScript value="/support/console/68.0/integration.js"/>
6 <script type="text/javascript">
7
8 function testSetCallAttachedData() {
9 //callData must be a JSON string. We assume that your browser has
10 //access to a JSON library.
11 var callData = JSON.stringify({"ANI":"4155551212", "DNIS":"8005551212"});
12
13 //Set the call attached data associated to call id 'call.1'
14 sforce.console.cti.setCallAttachedData('call.1', callData, 'outbound');
15 }
16 </script>
17</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. |