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.

setServicePresenceStatus for Lightning Experience

Sets an agent's presence status to a status with a particular ID. If the specified agent is not already logged in, we log in the agent with the presence status. This method removes the need for you to make more calls.

Arguments

Name Type Description
statusId string The ID of the presence status to which you want to set the agent. Agents must be given access to this presence status through their associated profile or permission set.

Sample Code

Component code:

Controller code:

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.
channels JSON string of channel objects Returns the IDs and API names of the channels associated with the presence status.