function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
praveenreddy gaddam 15praveenreddy gaddam 15 

How to open multiple sub tabs under a single primary tab using a aura components?

ravi soniravi soni
hy praveenreddy,
try following aura component.
<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId" access="global" >
   
    <lightning:workspaceAPI aura:id="workspace" />
    <lightning:button label="Open Tab with Subtab In aura" onclick="{! c.openTabWithSubtab }" />
   
 </aura:component>
 
({
    openTabWithSubtab : function(component, event, helper) {
       var workspaceAPI = component.find("workspace");
        workspaceAPI.openTab({
            recordId: component.get('v.recordId'),
            focus: true
        }).then(function(response) {
            alert('response====> ' + JSON.stringify(response));
            workspaceAPI.openSubtab({
                parentTabId: response,
                recordId:'0035g000004ASGqAAO',// dummy child record Id
                focus: true
            });
        })
        .catch(function(error) {
            console.log( 'Error is ' + error );
            alert( 'Error is ' + error);
        });  
    }
   
})
This Subtab component only work in console.
let me know if it helps you and marking it as best so that it can help to others in future.
Thank You