---
schema_version: "1"
id: e594e877749315c86ad516915e0f5516eae68df080a29a2957b1eefec59d4f4c
title: Tab Replaced
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/lightning/tabReplaced/aura-tab-replaced.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/aura-tab-replaced.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bb98ad25eafd719ec3a61eb825ee417f930c3e232694bb0fb150d71184c60513
products:
  - Lightning Component Reference
---
# 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

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

`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`.

```html
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
  <lightning:workspaceAPI aura:id="workspace" />
  <aura:handler event="lightning:tabReplaced" action="{! c.onTabReplaced }" />
</aura:component>
```

In your client-side controller, retrieve the ID of the replaced tab.

```javascript
({
    onTabReplaced : function(component, event, helper) {
        var replacedTabId = event.getParam("tabId");
        var workspaceAPI = component.find("workspace");
        workspaceAPI.getTabURL({
            tabId : replacedTabId;
            callback : function(error, response){
                console.log(response);
            }
        });
    }
})
```

For more information, see the [Salesforce Console Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/).


:::::

:::::tab
## Attributes

| Name    | Description                  | Type   | Default | Required                                     |
| ------- | ---------------------------- | ------ | ------- | -------------------------------------------- |
| `tabId` | The ID of the refreshed tab. | string |         | ![Yes](https://developer.salesforce.com/media/check.png) |

:::::

::::::
