Newer Version Available
getEnclosingTabId() for Lightning Experience
Returns the ID of the enclosing tab. This method works only in
Lightning console apps.
Arguments
None.
Sample Code
This component has a button that, when pressed, retrieves the enclosing tab ID.
Component code:
Controller code:
Response
This method returns a promise that, upon success, resolves to the
tabId of the enclosing tab, if within a tab, or
false if not within a tab.