Newer Version Available

This content describes an older version of this product. View Latest

Console API Method Parity—What’s Different Between Lightning Experience and Salesforce Classic?

The Lightning Console JavaScript API provides methods similar to those methods in the Salesforce Console Integration Toolkit.

This table shows which Salesforce Console Integration Toolkit (Salesforce Classic) methods map to Lightning Console JavaScript API (Lightning Experience) methods and events. Not every Salesforce Console Integration Toolkit has a Lightning analog. You can replicate some Classic methods using Lightning events, combining Lightning Experience methods, or using iterative and conditional logic with methods and events.

Only Salesforce Console Integration Toolkit methods with a Lightning Console JavaScript API or workaround appear in this table. Methods without alternatives or workarounds are not listed.

Important

Methods for Primary Tabs and Subtabs

Salesforce Console Integration Toolkit (Salesforce Classic) Lightning Console JavaScript API Method (Lightning Experience)
closeTab() closeTab()
focusPrimaryTabById() focusTab()
focusSubtabById() focusTab()
getEnclosingPrimaryTabId()

Use the Lightning method getEnclosingTabId(). If the calling component is within a subtab, then the subtab ID is returned. If the calling component is within a workspace tab, then the workspace ID is returned.

getEnclosingPrimaryTabObjectId() Use getEnclosingTabId() to get the tab ID. Then, use the tab ID to call getTabInfo(tabId), which includes the object ID in the response payload (if applicable).
getEnclosingTabId()

Use the Lightning method getEnclosingTabId(). If the calling component is within a subtab, then the subtab ID is returned. If the calling component is within a workspace tab, then the workspace ID is returned.

getFocusedPrimaryTabId() getFocusedTabInfo()
getFocusedPrimaryTabObjectId() getFocusedTabInfo()
getFocusedSubtabId() getFocusedTabInfo()
getPageInfo() getTabInfo()
getPrimaryTabIds() Not supported.

Workaround: Call getAllTabInfo().

getSubtabIds() Not supported.

Workaround: Call getAllTabInfo() to get a list of all workspace tab objects. Iterate through each workspace tab object, collecting subtab IDs where applicable

getTabLink() getTabURL()
onEnclosingTabRefresh() Use lightning:tabRefreshed with getEnclosingTabId().
onFocusedPrimaryTab() lightning:tabFocused
onFocusedSubtab() lightning:tabFocused
onTabSave() Not supported.
openConsoleUrl() openConsoleUrl()
openPrimaryTab() openTab()
openSubtab() openSubtab()
refreshPrimaryTabById() Use refreshTab() and specify a workspace tab ID.

The activate argument isn’t supported in the Lightning API. Use refreshTab() with focusTab(). instead.

refreshSubtabById() Use refreshTab() and specify a subtab ID.

The activate argument isn’t supported in the Lightning API. Use refreshTab() with focusTab(). instead.

setTabIcon() setTabIcon()
setTabTitle() setTabLabel()
setTabUnsavedChanges() Use the lightning:unsavedChanges component.

Methods for Navigation Tabs

The force:navigateToObjectHome Lightning event allows you to complete actions for many navigation tab methods in Salesforce Classic.

Methods for Live Agent

Salesforce Console Integration Toolkit (Salesforce Classic) Lightning Console JavaScript API Method (Lightning Experience)
endChat() endChat()
getChatLog() getChatLog()
sendCustomEvent() sendCustomEvent()
sendMessage() sendMessage()

Methods for Computer-Telephony Integration (CTI)

Salesforce Console Integration Toolkit (Salesforce Classic) Lightning Console JavaScript API Method (Lightning Experience)
onCallBegin() Not supported.
onCallEnd() Not supported.
onCallLogSaved() Not supported.