3

I was wondering what were the potential reasons of getting this problem, I also was wondering what are the potential solutions to solve this error.

I am using this within an aura cmp.

Chrome Console

This is where its calling from: component

Zoomed in

Component zoom

Also am getting this right after I open up the page.

Error Box

JS File

        window.setTimeout(
            $A.getCallback(function() {
                var workspaceAPI = component.find("workspace");
                workspaceAPI.getFocusedTabInfo()
                .then(function(tabInfo) {
                    workspaceAPI.setTabLabel({tabId : tabInfo.tabId, label : 'Page'});
                    workspaceAPI.setTabIcon({tabId : tabInfo.tabId, icon : 'utility:preview'});
                });
            }), 1
        );
    }
4
  • 2
    Where is this aura component being called? Is it from lightning consile app or sales app etc? Can you show a screenshot or let us know that? Commented Nov 11, 2021 at 1:35
  • It's being called from the lightning console. The error is showing up within the browsers (chrome) console.
    – John
    Commented Nov 12, 2021 at 0:10
  • Can you share full screenshot of the page from where this is called. Commented Nov 12, 2021 at 1:21
  • Oops so sorry, Its actually in Sales app, I'll update the picture.
    – John
    Commented Nov 12, 2021 at 16:10

2 Answers 2

0

Workspace api method only works in console based application. For eg: Lightning console or Service Console . It won't work on Sales App.

From documentation:

This component allows you to access methods for programmatically controlling workspace tabs and subtabs in a Lightning console app.

https://developer.salesforce.com/docs/component-library/bundle/lightning:workspaceAPI/documentation

0

I found that, depending on what level your tab is on this error will be thrown. If its not opened on the default tab, you wont see this error.

You must log in to answer this question.

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