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.
getServicePresenceStatusChannels for Lightning Experience
Retrieves the service channels that are associated with an Omni-Channel user’s
current presence status.
Sample Code
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:omniToolkitAPI aura:id="omniToolkit" />
3 <lightning:button label="Get Status Channels" onclick="{! c.getStatusChannels }" />
4</aura:component>Controller code:
1({
2 getStatusChannels: function(cmp, evt, hlp) {
3 var omniAPI = cmp.find("omniToolkit");
4 omniAPI.getServicePresenceStatusChannels().then(function(result) {
5 var channels = JSON.parse(result.channels);
6 //For example purposes, just retrieve the first channel
7 console.log('First channel ID is: ' + channels[0].channelId);
8 console.log('First channel developer name is: ' + channels[0].developerName);
9 }).catch(function(error) {
10 console.log(error);
11 });
12 }
13})