Tab Replaced

lightning:tabReplaced

Fires when a Console primary tab or subtab has been successfully replaced, such as when saving a new record and the create form is replaced with the newly created Record Home.

For Use In

Lightning Experience

lightning:tabReplaced is an application event that indicates a tab has been replaced successfully. This event is supported in Lightning console apps only.

Handle the event using aura:handler.

1<aura:component implements="flexipage:availableForAllPageTypes" access="global">
2  <lightning:workspaceAPI aura:id="workspace" />
3  <aura:handler event="lightning:tabReplaced" action="{! c.onTabReplaced }" />
4</aura:component>

In your client-side controller, retrieve the ID of the replaced tab.

1({
2    onTabReplaced : function(component, event, helper) {
3        var replacedTabId = event.getParam("tabId");
4        var workspaceAPI = component.find("workspace");
5        workspaceAPI.getTabURL({
6            tabId : replacedTabId;
7            callback : function(error, response){
8                console.log(response);
9            }
10        });
11    }
12})

For more information, see the Salesforce Console Developer Guide.

Attributes 

NameDescriptionTypeDefaultRequired
tabIdThe ID of the refreshed tab.stringYes