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.
getServicePresenceStatusId for Lightning Experience
Retrieves an agent’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" onclick="{! c.getStatus }" />
4</aura:component>Controller code:
1({
2 getStatus: function(cmp, evt, hlp) {
3 var omniAPI = cmp.find("omniToolkit");
4 omniAPI.getServicePresenceStatusId().then(function(result) {
5 console.log('Status Id is: ' + result.statusId);
6 }).catch(function(error) {
7 console.log(error);
8 });
9 }
10})Response
This method returns a promise that, upon success, resolves to an object, containing the following fields.
| Name | Type | Description |
|---|---|---|
| statusName | string | The name of the agent’s current presence status. |
| statusApiName | string | The API name of the agent’s current presence status. |
| statusId | string | The ID of the agent’s current presence status. |