Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

In the service console toolkit its not possible to open same record in two tabs since the tabs needs to be unique, reasons for which i understand. But i am in a scenario where in, on clicking a link in the VF page i am trying to directly open a new primary tab and getting an error as "Cannot open primary tab :Duplicate tab exists". So basically i need to check if that record is already part of any of the primary or secondary tabs and if so i need to focus on that tab instead of opening a new tab.

But in the toolkit developer guide i dont see any methods available to check if the tab is part of the console. How to i implement the logic of checking if the record is already opened and only if not open a new tab, is there a better way than this logic?

share|improve this question
    
I reckon you will have handle the exception in a JavaScript try catch block and ignore it if the text matches. –  techtrekker Dec 4 '12 at 13:09
    
but if u see the methods of the toolkit like getEnclosingPrimaryTabId(),getEnclosingPrimaryTabObjectId,getEnclosingTabId(),ge‌​tFocusedPrimaryTabId(),getFocusedPrimaryTabObjectId(),onFocusedPrimaryTab(),getFo‌​cusedSubtabId(), getFocusedSubtabObjectId() everything only tells me whats the primary or secondary tab in the context but i dont see any method which has visibility over the entire console tabs. –  Anil Dec 4 '12 at 13:24
    
Hence why, handling the exception in javascript should work, so you don't proactively check if the tab is already open, but swallow the exception, if one occurs, where an attempt is being made to open an already open subtab. –  techtrekker Dec 4 '12 at 13:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.