my goal is to keep only one contact TAB opened in Console all the time , if there is already a tab opened i need to close it and open the new tab.
I have a VF section on standard detail page and i added addEventListener for OPEN_TAB. When the EventListener function executes on TAB open getting the error saying un supported API function. does it means i can't add EventListener on a VF section? if so is there in other work around for this?
function getAllTabIds() {
// get all Tab ID's
sforce.console.getEnclosingPrimaryTabIds(closeAlltabs);
}
var closeAlltabs = function closeAlltabs(results) {
alert('closeAlltabs Called'+result.ids);
var tabId = result.id;
};
sforce.console.addEventListener(sforce.console.ConsoleEvent.OPEN_TAB,
getAllTabIds, { tabId : sforce.console.getEnclosingTabId() });