1

I have a requirement to replace a primary tab in lightning console with another record. I have tried to implement it the way described in this link. When I call closeTab, I am always getting what looks like an internal error:

[PromiseRejection: Error: getTabInfo() - Failed to get tabInfo for tabId ctab0] t.$$lwcEventWrapper$$()@https://*--devsis.lightning.force.com/auraFW/javascript/uZhR234ENYM5YJpipvJEkg/aura_prod.js:2:14001**

Even if I comment out opening the tab, I get the same error, so the error seems to be an issue with closeTab. This is using Summer 19. Has anyone been able to successfully use this logic in Summer 19?

4

2 Answers 2

0
goToAcct : function(component, event, helper) {
var acid = event.target.id;

var workspaceAPI = component.find("workspace");
    workspaceAPI.getFocusedTabInfo().then(function(response) {
        var focusedTabId = response.tabId;
        console.log(focusedTabId);

        //Opening New Tab
        workspaceAPI.openTab({
           pageReference: {
      type: "standard__recordPage",
      attributes: {
        recordId: acid,
        actionName: "view"
      },
      state: {}
    },
    focus: true
        }).then(function(response) {
            workspaceAPI.focusTab({tabId : response});
        })
        .catch(function(error) {
            console.log(error);
        });

        //Closing old one
        // workspaceAPI.closeTab({tabId: focusedTabId});
    })
    .catch(function(error) {
        console.log(error);
    }); 

}

0

This is a false flag, the issue was due to a handler being called when the tab was closed, which was trying to look at the closed (and therefore non existent) tab.

2
  • This is still happening in our UAT org, when we close tab. Commented Sep 12, 2019 at 12:55
  • Like I said, it is probably a side effect of something else.
    – hamayoun
    Commented Sep 12, 2019 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .