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(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
1<apex:page>
2 <apex:includeScript value="/support/console/67.0/integration.js"/>
3 <a href="#" onClick="testGetChannels();return false;">
4 Get Channels Associated with a Presence Status
5 </a>
6
7 <script type="text/javascript">
8 function testGetChannels() {
9 //These values are for example purposes only.
10 sforce.console.presence.getServicePresenceStatusChannels(function(result) {
11 if (result.success) {
12 alert('Retrieved Service Presence Status Channels successfully');
13 var channels = JSON.parse(result.channels);
14 //For example purposes, just retrieve the first channel
15 alert('First channel ID is: ' + channels[0].channelId);
16 alert('First channel developer name is: ' + channels[0].developerName);
17 } else {
18 alert('Get Service Presence Status Channels failed');
19 }
20 });
21 }
22 </script>
23</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: