Newer Version Available
getServicePresenceStatusChannels
Retrieves the service channels that are associated with an Omni-Channel user’s current presence status. Available in API versions 32.0 and later.
Syntax
1sforce.console.presence.getServicePresenceStatusChannels((optional) callback:function)Arguments
| Name | Type | Description |
|---|---|---|
| callback | function | JavaScript method to call when the channels associated with a presence status are retrieved. |
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 <apex:includeScript value="/support/console/34.0/integration.js"/>
19 <a href="#" onClick="testGetChannels();return false;">
20 Get Channels Associated with a Presence Status
21 </a>
22
23 <script type="text/javascript">
24 function testGetChannels() {
25 //These values are for example purposes only.
26 sforce.console.presence.getServicePresenceStatusChannels(function(result) {
27 if (result.success) {
28 alert('Retrieved Service Presence Status Channels successfully');
29 var channels = JSON.parse(result.channels);
30 //For example purposes, just retrieve the first channel
31 alert('First channel ID is: ' + channels[0].channelId);
32 alert('First channel developer name is: ' + channels[0].developerName);
33 } else {
34 alert('Get Service Presence Status Channels failed');
35 }
36 });
37 }
38 </script>
39</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 properties: