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

For Lightning Experience, you can build your apps using Lightning Web Components (LWC) and Aura components. Both can interoperate on the same page.

Methods for Primary Tabs and Subtabs

Salesforce Console Integration Toolkit (Salesforce Classic) Lightning Console JavaScript API Method (Aura Components for Lightning Experience) LWC Support
closeTab() closeTab() Same as Aura Components.
focusPrimaryTabById() focusTab() Same as Aura Components.
focusSubtabById() focusTab() Same as Aura Components.
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.

Use the EnclosingTabId wire adapter.
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). Use the EnclosingTabId wire adapter.
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.

Use the EnclosingTabId wire adapter.
getFocusedPrimaryTabId() getFocusedTabInfo() Same as Aura Components.
getFocusedPrimaryTabObjectId() getFocusedTabInfo() Same as Aura Components.
getFocusedSubtabId() getFocusedTabInfo() Same as Aura Components.
getPageInfo() getTabInfo() Same as Aura Components.
getPrimaryTabIds() Not supported.

Workaround: Call getAllTabInfo().

Same as Aura Components.
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

Same as Aura Components.
getTabLink() getTabURL() Use getTabInfo().
onEnclosingTabRefresh() Use lightning:tabRefreshed with getEnclosingTabId(). Use the lightning__tabRefreshed Lightning message channel.
onFocusedPrimaryTab() lightning:tabFocused Use the lightning__tabFocused Lightning message channel.
onFocusedSubtab() lightning:tabFocused Use the lightning__tabFocused Lightning message channel.
onTabSave() Not supported. Not supported.
openConsoleUrl() openConsoleUrl() Not supported.
openPrimaryTab() openTab() Same as Aura Components.
openSubtab() openSubtab() Same as Aura Components.
refreshPrimaryTabById() Use refreshTab() and specify a workspace tab ID.

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

Same as Aura Components.
refreshSubtabById() Use refreshTab() and specify a subtab ID.

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

Same as Aura Components.
setTabIcon() setTabIcon() Same as Aura Components.
setTabTitle() setTabLabel() Same as Aura Components.
setTabUnsavedChanges() Use the lightning:unsavedChanges component. Not supported.

Methods for Navigation Tabs

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

LWC doesn’t currently support working with navigation tabs.

Note

Methods for Live Agent

LWC doesn’t currently support working with Live Agent.

Note

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)

LWC doesn’t currently support working with CTI.

Note

Salesforce Console Integration Toolkit (Salesforce Classic) Lightning Console JavaScript API Method (Lightning Experience)
onCallBegin() Not supported for both Aura and LWC.
onCallEnd() Not supported for both Aura and LWC.
onCallLogSaved() Not supported for both Aura and LWC..