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.
Two-Way Rep Status Syncing
For example, a telephony partner system can have scheduled time breaks for the reps where the partner wants to change the rep status in Omni accordingly. If a rep is on a call, status change is ignored and doesn’t have any impact. In order to support complete two-way syncing of the status between Omni and the telephony system, the telephony system must persist a table with mapping between the Salesforce status ID and the partner status.
When the connector loads, the init() API is called, and the argument callCenterConfig contains a JSON field called userPresenceStatuses that can be parsed into a map of statusId: statusInfo. For example:
1{
2 "0": {
3 "statusName": "Offline",
4 "hasChannels": "false",
5 "isOffline": "true",
6 "statusId": "0"
7 },
8 "0N5xx0000004CSO": {
9 "statusName": "Available",
10 "hasChannels": "true",
11 "isOffline": "false",
12 "statusId": "0N5xx0000004CSO"
13 },
14 "0N5xx0000004D56": {
15 "statusName": "Away",
16 "hasChannels": "false",
17 "isOffline": "false",
18 "statusId": "0N5xx0000004D56"
19 },
20 "0N5xx0000004D3U": {
21 "statusName": "Busy",
22 "hasChannels": "false",
23 "isOffline": "false",
24 "statusId": "0N5xx0000004D3U"
25 }
26}The statusId 0 is reserved for the Offline status. Other statusIDs represent Salesforce Omni-Channel presence statuses that are available for the user.
The statusInfo fields are:
- statusName: The name of the status.
- hasChannels: false indicates that the status is busy or offline. true indicates that it’s routable by a channel.
- isOffline: true indicates that it’s an offline status (with statusId 0).
- statusId: Salesforce status ID
In order to invoke the status change from the connector, call publishEvent() with the event SET_AGENT_STATUS and the required status ID. For example:
1Const statusId = "0N5xx0000004D3U";
2publishEvent({ eventType: "SET_AGENT_STATUS", payload: new AgentStatusInfo({ statusId }) });To change the status to offline:
1Const offlineStatusId = "0";
2publishEvent({ eventType: "SET_AGENT_STATUS", payload: new AgentStatusInfo({ statusId: offlineStatusId })});See setAgentStatus() for information on how to update the vendor rep status when the Omni-Channel status changes.