Salesforce Console API

More of the Salesforce Console Integration Toolkit JavaScript APIs are available in the Lightning Console JavaScript API. Work with the navigation item in a console app, refresh a console tab, and register an event handler for a utility. Live Agent and Omni-Channel also have new methods and events.

Where: This change applies to Lightning Experience and Salesforce Classic in Professional, Enterprise, Performance, Unlimited, and Developer editions.

How: The following methods are new or have changed in API version 43.0.

Navigation Items
focusNavigationItem()
Focuses on the selected navigation object, and opens the object’s home page. Typically, standard and custom objects open the object’s list view. If split view is open, the focus remains on the selected navigation object.
getNavigationItems()
Returns information about all items in the item menu.
getSelectedNavigationItem()
Returns information about the selected navigation item.
refreshNavigationItem()
Refreshes the selected navigation object’s home page. Typically, standard and custom objects open the object’s list view. If split view is open, it’s refreshed.
Workspace Tabs and Subtabs
refreshTab()
Refreshes a workspace tab or a subtab specified by tabId. Keep in mind that the first subtab has the same tabId as the workspace tab.
disableTabClose()
Prevents a workspace tab or subtab from closing. This method removes the close button from a tab or subtab, and disables the keyboard shortcuts that close tabs and subtabs.
setTabHighlighted()
A new argument draws attention to a tab with an animation.
openTab()
Added support for the new Lightning URL format in the URL argument.
openSubtab()
Added support for the new Lightning URL format in the URL argument.
Utilities
onUtilityClick()
Registers an event handler for the utility. The event handler is called when the utility is clicked.
Live Agent
endChat()

Ends a chat that an agent is engaged in.

getChatLog()

Returns the log of a chat associated with a specific chat key.

sendCustomEvent()

Sends a custom event to the client-side chat window for a chat with a specific chat key.

sendMessage()
Sends a new chat message from the agent to a chat with a specific chat key.
Omni-Channel
acceptAgentWork()

Accepts a work item that’s assigned to an agent.

closeAgentWork()

Changes the status of a work item to “Closed” and removes it from the list of work items in the Omni-Channel utility.

declineAgentWork()

Declines a work item that’s assigned to an agent.

getAgentWorkload()

Retrieves an agent’s currently assigned workload. Use this method for rerouting work to available agents.

getAgentWorks()

Returns a list of work items that are currently assigned to an agent and open in the agent’s workspace.

getServicePresenceStatusChannels()

Retrieves the service channels that are associated with an Omni-Channel user’s current presence status.

getServicePresenceStatusId()

Retrieves an agent’s current presence status.

login()

Logs an agent in to Omni-Channel with a specific presence status. You also can use this method to reconnect to Omni-Channel after a connection error.

logout()

Logs an agent out of Omni-Channel.

setServicePresenceStatus()

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. You also can use this method to reconnect to Omni-Channel after a connection error.