+ Start a Discussion
mukesh guptamukesh gupta 

Sales console tab not close

Hi I am using visualforce page to open Lightninng component in new tab:-

on opportunity object -->> button & Link (Name:-AddProduct)

add URL parameter :- 


when user click on 'AddProduct' button then below VF page open in new tab with lightnig component:-

<apex:page controller="TestController" tabStyle="Opportunity" lightningStylesheets="true">
    <apex:includeLightning />
    <div class="slds" style="margin-top:10px;margin-left:10px;"> 
        <div id="lightning" />

        $Lightning.use("c:AddProductApp", function() {
                {recordId : "{!OpportunityId}"},
                function(cmp) {

i have a close button in AddProductController to close this tab but not able to closed this tab getting UNDEFINED in console log. i am not able to get TabId by this code.

Close : function(component, event, helper){
        var workspaceAPI = component.find("workspace"); // mentioned in component 
          workspaceAPI.isConsoleNavigation().then(function(consoleResponse) {  
              console.log('consoleResponse-->>> '+consoleResponse) // return undefined
              workspaceAPI.getFocusedTabInfo().then(function(tabResponse) {
                  console.log('tabResponse-->> '+tabResponse)// return undefined
                   var isSubtab = tabResponse.isSubtab;
                  console.log('isSubtab-->> '+isSubtab);// return undefined
Please suggest and let me know where i am wrong