Find your content:

Search form

You are here

Open a Service Console primary tab from a custom component module


I have a app-level custom component module (the ones in the footer) for a service cloud application. I need to open up a Primary Tab in the console from this custom component.

I have the Id of the Account that I want to open the primary tab for but I am running into issues because the component seems to be a child window of the main console. This is giving me the following issues:

sforce.console.openPrimaryTab(accountId, "/ui/support/servicedesk/ServiceDeskPage", true);

The above code doesn't work (nothing happens at all), I think because there is no console in the child window. I need to reach the console window via window.parent.

window.parent.location.replace('/' + accountId);

This actually works, but it opens the record in the standard sales cloud view rather than in the service cloud.

I have also tried:

window.parent.sforce.console.openPrimaryTab(accountId, "/ui/support/servicedesk/ServiceDeskPage", true);

but I get a Permission denied to access property sforce error

Is there any way I can open a tab from the component?

Also, I am confused as to the second parameter of the openPrimaryTab method (the url). I am assuming that it requires the url of the console.

Many thanks in advance


Looking at chrome's console readout, I see that I'm getting the following error:

Unsafe JavaScript attempt to access frame with URL [salesforce console domain] from frame with URL [visualforce domain e.g.] Domains, protocols and ports must match.

From the article linked to in @techtrekkers comment:

Visualforce pages don’t have access to the srcUp() method, and hence need the Service Cloud Integration Toolkit methods to open new subtabs/ primary tabs.

Attribution to: Joe

Possible Suggestion/Solution #1

I managed to launch a Primary Tab from a Custom Console Component, using this openPrimaryTab sample page as the Custom Console Component.

I had to whitelist the domain that I wanted to launch, so in this case in the Service Console App Settings (Whitelist domains)

The Primary Tab does launch alright, although the cross domain error message that you mentioned comes up in the javascript console, I would guess because Visualforce is served up from a different domain.

Attribution to: techtrekker

Possible Suggestion/Solution #2

in your Advanced User Details de-select the below options

-Development Mode -Show View State in Development Mode

I went through same issue as you the above solved my issue, because when you enable those options the VF page is in an extra iframe which causes this.

Attribution to: user3932916
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content