I'm experiencing a weird js error while trying to run the openSubtab() salesforce console integration API method.

This is my method call :

sforce.console.openSubtab(ctiTabId, theURL,true,'{!Case.caseNumber}',function(result){
        //some custom logic
        some other custom logic

The error I get is the following:

openSubTab: Invalid ID: scc-st-0

Now, the strange thing is : ctiTabId param refers (it's the one in the image below) to what I expect to be a primary tab, not a subtab itself. Instead, the system sees is as a subtab, avoiding me to open a subtab under it, of course.

So at this point the question would be: why is my primary tab interpreted as a subtab?

enter image description here

  • 1
    Can you please share how you get ctiTabId in the first place?
    – Adrian Larson
    Commented Sep 6, 2016 at 16:20

1 Answer 1


What your screenshot shows is indeed a primary tab 'Mario Rossi'. But what you don't see is that there is actually a 'Details' subtab contained within that primary tab. Were you to open additional subtabs you would then see the 'Details' subtab shown like this:

enter image description here

My assumption is you're using a method like getEnclosingTabId() to get the tab ID before passing it into openSubtab, and it's getting the ID out of the subtab because that's where it's actually running. I'd suggest using something like getEnclosingPrimaryTabId() or getFocusedPrimaryTabId() which is sure to return the primary tab ID.

  • thanks, it worked! I was using getEnclosingTabId.. the getEnclosingPrimaryTabId, instead, gives me the right primary tab id as well!
    – user9959
    Commented Sep 7, 2016 at 10:35

You must log in to answer this question.