I have a primary tab that has a subtab in it. I want to remove that subtab and open a new subtab. The new subtab is an account page. I am able to get into both openSubtab
and closeTab
methods. The closeTab()
method is working but the openSubtab
is not firing off the page open. I put an alert on it to make sure that it was firing at all and it is being called. I am not entirely sure what is happening. My thoughts are it is order of execution or my url param is not written correctly because it is in console. When I console.log my url param I get: /apex/001g000001jDRCiCAO
. Does anyone have any ideas?
if(sforce.console.isInConsole()){
sforce.console.openPrimaryTab(null, conversationSessionPrefix, true, '{!HTMLENCODE($Label.livetext__txt_conversation)}');
var closeSubtab = function closeSubtab(result) {
var tabId = result.id;
sforce.console.closeTab(tabId);
};
sforce.console.getEnclosingTabId(closeSubtab);
var openSubtab = function openSubtab(result) {
var tabId = result.id;
sforce.console.openSubtab(tabId , '/apex/' + accountId, true);
};
sforce.console.getPrimaryTabIds(openSubtab);
}
UPDATE: After combing through the console responses it is telling me that my ID for the subtab is invalid. I will report back when I figure out why it is invalid!
More Updates: "openSubTab: Opening a duplicate tab is not allowed."