Long Story short no matter what i do i cannot make this salesforce method work. Please help me shine some light on what i am doing wrong so i can work on creating subtabs from an Account page inside of my service console.

<apex:page standardController="Account" showHeader="false" sidebar="false" >   
    <apex:includeScript value="/soap/ajax/39.0/connection.js"/> 
    <apex:includeScript value="/soap/ajax/39.0/apex.js"/> 
    <apex:includeScript value="/support/console/39.0/integration.js"/>

    <script type="text/javascript">
        function testIsInConsole() {
            if (sforce.console.isInConsole()) 
                alert('in console');
                alert('not in console');

    <apex:commandButton oncomplete="testIsInConsole()"   value="Click here 
    to check if the page is in the Service Cloud console"/>

View from Console

  • I was just looking at you answering someone else on a similar issue. This page is embedded into the account page layout, at a high level i am overriding the default contact related list with my own custom related list since. Will this help me at all? salesforce.stackexchange.com/questions/145016/… @santanuboral – Justin Price Apr 17 '17 at 16:23
  • yes, I have answered this earlier – Santanu Boral Apr 17 '17 at 16:25
  • I can see that, but going deeper if the default IsInConsole does not work, how will i find the primaryTabId, in order to make a subtab. Is your solution not a work around? – Justin Price Apr 17 '17 at 16:27
  • how are you opening this visualforce page? is that page opening on PrimaryTab? – Santanu Boral Apr 17 '17 at 16:30
  • I added an image above, the visual force page is embedded into the primary tab. right now i can create other primary tabs, but cannot create subtabs. I am assuming i cannot create subtabs because my visualforce page does not believe i am inside of the console to get the primary tabs id – Justin Price Apr 17 '17 at 16:37

If you are opening the standard record from listview in console then page will be in console.

It works perfectly based on your code.

page in console

Issue is: Your development mode is opened.

Close the development mode option and it will work perfectly.

| improve this answer | |
  • That was exactly the issue. developer mode open caused the issue. – Justin Price Apr 17 '17 at 17:11
  • 2
    Just for some extra flavor to this answer: turning on development mode will cause your VF Page to become nested. The development mode creates an iframe and the VF page is a second iframe inside of that one. The console toolkit has some limitations around nested frames and this is one of them. It "looks up" to see where it is, and instead of seeing the console it sees the development mode frame and decides it's not in the console after all. developer.salesforce.com/docs/atlas.en-us.api_console.meta/… – Paul H. Apr 21 '17 at 23:46
  • Nice explanations – Santanu Boral Apr 22 '17 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.