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
Shravan Kumar 71Shravan Kumar 71 

Open link in subtab in Lightning Console

Hello Trailblazers, 

When a user clicks on the link, it should open in a subtab in lightning console. Below is the VF page that I have come up with, however it's not working as expected. Any inputs will be highly appreciated. 
<apex:page standardController="LiveChatTranscript" extensions="PastChatSearchController">
    <apex:includeScript value="/support/console/45.0/integration.js"/>
    var preRecordId;    
    function openSubtab(id, name) 
        preRecordId= id;    
        if (sforce.console.isInConsole())
   = '/' + id;
    var openSubtab = function openSubtab(result) 
        var primaryTabId =;        
        sforce.console.openSubtab(primaryTabId, '/'+preRecordId, true, preRecordId , null , openSuccess, 'salesforceSubtab');
    <apex:form >
        <apex:pageBlock id="pb">
            <apex:pageMessages ></apex:pageMessages>
            <apex:pageBlockTable value="{!LiveChatTranscript}" var="d">
                <apex:column headerValue="Live Chat Transcript Name">
             <!--       <apex:outputLink target="_blank" style="color:blue" value="{!URLFOR($Action.LiveChatTranscript.View, d.ID)}"> {!d.Name} 
                    </apex:outputLink> -->
                    <a href="#" onclick="openSubtab('{!}', '{!}');return false">{!d.Name}</a>
                <apex:column headerValue="CreatedDate">                  
                    <apex:outputField value="{!d.CreatedDate}">                               

Thank you
Khan AnasKhan Anas (Salesforce Developers) 
Hi Shravan,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F0000000BTpTIAW

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Raj VakatiRaj Vakati
I can suggest to use the lightning console  workspace API .. 

Please refer this code

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <lightning:workspaceAPI aura:id="workspace" />
    <lightning:button label="Open Tab with Subtab" onclick="{! c.openTabWithSubtab }" />
    openTabWithSubtab : function(component, event, helper) {
        var workspaceAPI = component.find("workspace");
            url: '/lightning/r/Account/001xx000003DI05AAG/view',
            focus: true
        }).then(function(response) {
                parentTabId: response,
                url: '/lightning/r/Contact/003xx000004Ts30AAC/view',
                focus: true
        .catch(function(error) {