Classic Console API Methods Supported in the Lightning Console API

Visualforce pages and third-party web tabs that use some Salesforce Console Integration Toolkit methods work in Lightning Experience as-is. Just point to the latest version of the toolkit script in your Visualforce pages or third-party web tabs. Third-party content must be allowlisted with CSP directives via Trusted URLs. This table lists the Salesforce Console Integration Toolkit methods that you can use in Lightning Console JavaScript API starting with API version 42.0.

Salesforce Console Integration Toolkit methods that aren’t supported in Lightning Experience result in a failure error message.

Only API versions 42.0 and above of the Salesforce Console Integration Toolkit are supported in the Lightning Console JavaScript API. Only API versions 43.0 and above are supported in Open CTI.

Important

Methods for Primary Tabs and Subtabs 

Methods using objectId return 18-character, case-insensitive record IDs when invoked from within a Lightning console. When invoked from within a Salesforce Classic console, they return 15-character, case-sensitive record IDs.

Workspace tab and subtab IDs in a Lightning console use a different format from Salesforce Classic console primary tab and subtab IDs. Any code that validates the format of tab IDs must be updated or removed to account for the change. A Salesforce Classic console tab ID can look like scc-pt-1 or scc-st-1. A Lightning console tab ID looks like ctab1 or ctab1_3.

Note

Salesforce Classic MethodSupported in Lightning Console (Aura)Supported in Lightning Console (LWC)Notes About Use in Lightning Console
closeTab()Checkmark iconCheckmark icon 
disableTabClose()Checkmark iconCheckmark icon 
focusPrimaryTabById()Checkmark iconCheckmark icon 
focusPrimaryTabByName()Red x markRed x mark 
focusSidebarComponent()Red x markRed x mark 
focusSubtabById()Checkmark iconCheckmark icon 
focusSubtabByNameAndPrimaryTabId()Red x markRed x mark 
focusSubtabByNameAndPrimaryTabName()Red x markRed x mark 
generateConsoleUrl()Red x markRed x mark 
getEnclosingPrimaryTabId()Checkmark iconRed x mark 
getEnclosingTabId()Checkmark iconCheckmark icon 
getFocusedPrimaryTabId()Checkmark iconCheckmark icon 
getFocusedPrimaryTabObjectId()Checkmark iconCheckmark icon 
getFocusedSubtabId()Checkmark iconCheckmark icon 
getFocusedSubtabObjectId()Checkmark iconRed x mark 
getPageInfo()See notesRed x markThese fields aren’t supported and aren’t returned in the response:
  • object
  • displayName
  • accountId
  • contactId
  • personAccount
getPrimaryTabIds()Checkmark iconCheckmark icon 
getSubtabIds()Checkmark iconRed x mark 
getTabLink()See notesRed x markThe level argument sforce.console.TabLink.PARENT_AND_CHILDREN isn’t supported.
isInConsole()Checkmark iconCheckmark icon 
onEnclosingTabRefresh()Checkmark iconRed x mark 
onFocusedPrimaryTab()Checkmark iconRed x mark 
onFocusedSubtab()Checkmark iconRed x markUtility items aren’t supported in the Lightning API.
onTabSave()Red x markRed x mark 
openConsoleUrl()Red x markRed x mark 
openPrimaryTab()See notesSee notesMake sure to add third-party domains to the Trusted URLs list. The following aren’t supported in the Lightning API:
  • id argument
  • name argument. As an alternative, save the tabId that’s returned and use it in your API calls.
openSubtab()See notesSee notesMake sure to add third-party domains to the Trusted URLs list. The following aren’t supported in the Lightning API:
  • id argument
  • name argument. As an alternative, save the tabId that’s returned and use it in your API calls.
openSubtabByPrimaryTabName()Red x markCheckmark icon 
refreshPrimaryTabById()See notesSee notesThe fullRefresh argument isn’t supported in the Lightning API.
refreshPrimaryTabByName()Red x markCheckmark icon 
refreshSubtabById()See notesSee notesThe fullRefresh argument isn’t supported in the Lightning API.
refreshSubtabByNameAndPrimaryTabId()Red x markRed x mark 
refreshSubtabByNameAndPrimaryTabName()Red x markRed x mark 
reopenLastClosedTab()Red x markRed x mark 
resetSessionTimeOut()Red x markRed x mark 
setTabUnsavedChanges()Red x markRed x mark 
setTabIcon()See notesSee notesOnly Salesforce Lightning Design System icons are supported for iconUrl. URLs and custom icons aren’t supported. Sample supported values:
  • sforce.console.setTabIcon(“standard:email”)
  • sforce.console.setTabIcon(“action:new”)
  • sforce.console.setTabIcon(“custom:custom1”)
setTabLink()Checkmark iconRed x mark 
setTabStyle()Red x markRed x mark 
setTabTextStyle()Red x markRed x mark 
setTabTitle()Checkmark iconCheckmark icon 

Methods for Application-Level Custom Console Components 

LWC doesn’t currently support working with these methods.

Note

The following methods must be called from within a Lightning utility.

Salesforce Classic MethodSupported in Lightning ConsoleNotes About Use in Lightning Console
addToBrowserTitleQueue()Checkmark icon 
blinkCustomConsoleComponentButtonText()Red x mark 
isCustomConsoleComponentPoppedOut()Checkmark icon 
isCustomConsoleComponentHidden()Checkmark icon 
isInCustomConsoleComponent()Checkmark icon 
onCustomConsoleComponentButtonClicked()Checkmark icon 
removeFromBrowserTitleQueue()Checkmark icon 
runSelectedMacro()Red x mark 
scrollCustomConsoleComponentButtonText()Red x mark 
selectMacro()Red x mark 
setCustomConsoleComponentButtonIconUrl()See notesIn Lightning Console, URL values for icons aren’t supported in utility bar utilities. Only Salesforce Lightning Design System are supported. Sample supported iconUrl values:
  • setCustomConsoleComponentButtonIconUrl("clock");
  • setCustomConsoleComponentButtonIconUrl("utility:clock");
setCustomConsoleComponentButtonStyle()Red x mark 
setCustomConsoleComponentButtonText()Checkmark icon 
setCustomConsoleComponentHeight()Checkmark icon 
setCustomConsoleComponentVisible()Checkmark icon 
setCustomConsoleComponentWidth()Checkmark icon 
setCustomConsoleComponentPopoutable()Checkmark icon 
setCustomConsoleComponentWindowVisible()Red x mark 
setSidebarVisible()Red x mark 

Methods for Navigation Tabs 

LWC doesn’t currently support working with these methods.

Note

Salesforce Classic MethodSupported in Lightning ConsoleNotes About Use in Lightning Console
focusNavigationTab()Checkmark icon 
getNavigationTabs()Checkmark icon 
getSelectedNavigationTab()Checkmark icon 
refreshNavigationTab()Checkmark icon 
setSelectedNavigationTab()Red x mark 

Methods for Live Agent 

LWC doesn’t currently support working with these methods.

Note

Salesforce Classic MethodSupported in Lightning ConsoleNotes About Use in Lightning Console
acceptChat()Red x mark 
cancelFileTransferByAgent()Red x mark 
declineChat()Checkmark icon 
endChat()Checkmark icon 
getAgentInput()Red x mark 
getAgentState()Red x mark 
getChatLog()Checkmark icon 
getChatRequests()Red x mark 
getDetailsByChatKey()Red x mark 
getDetailsByPrimaryTabId()Red x mark 
getEngagedChats()Red x mark 
getMaxCapacity()Red x mark 
initFileTransfer()Red x mark 
onAgentSend()Red x mark 
onAgentStateChanged()Red x mark 
onChatCanceled()Red x mark 
onChatCriticalWaitState()Red x mark 
onChatDeclined()Red x mark 
onChatEnded()Red x mark 
onChatRequested()Red x mark 
onChatStarted()Red x mark 
onChatTransferredOut()Red x mark 
onCurrentCapacityChanged()Red x mark 
onCustomEvent()Red x mark 
onFileTransferCompleted()Red x mark 
onNewMessage()Red x mark 
onTypingUpdate()Red x mark 
sendCustomEvent()Checkmark icon 
sendMessage()Checkmark icon 
setAgentInput()Red x mark 
setAgentState()Red x mark 

Methods for Omni-Channel 

LWC doesn’t currently support working with these methods.

Note

Salesforce Classic MethodSupported in Lightning ConsoleNotes About Use in Lightning Console
acceptAgentWork()Checkmark icon 
closeAgentWork()Checkmark icon 
declineAgentWork()Checkmark icon 
getAgentWorkload()Checkmark icon 
getAgentWorks()Checkmark icon 
getServicePresenceStatusChannels()Checkmark icon 
getServicePresenceStatusId()Checkmark icon 
login()Checkmark icon 
logout()Checkmark icon 
setServicePresenceStatus()Checkmark icon 

Methods for Console Events 

LWC doesn’t currently support working with these methods.

Note

Salesforce Classic MethodSupported in Lightning ConsoleNotes About Use in Lightning Console
addEventListener()Checkmark iconsforce.console.ConsoleEvent.CONSOLE_LOGOUT isn’t supported in the Lightning API. sforce.console.ConsoleEvent.CLOSE_TAB returns the ID of the closed tab only. The Lightning API doesn’t return the objectId or the tabObjectId. The Lightning API doesn’t return special message responses from custom keyboard shortcuts. However, if the response is from a console event, the message includes payload details.
fireEvent()See notesfireEvent() returns success true even when eventListeners for the given eventType are removed.
removeEventListener()Checkmark icon