Newer Version Available

This content describes an older version of this product. View Latest

isInConsole()

Usage

Determines if the page is in the Salesforce console. This method is only available in API version 22.0 or later.

Syntax

1sforce.console.isInConsole()

Arguments

None

Sample Code–Visualforce

1swfobject.registerObject("clippy.codeblock-1", "9");<apex:page standardController="Case">
2    <A HREF="#" onClick="testIsInConsole();return false">
3         Click here to check if the page is in the Service Cloud console</A> 
4
5    <apex:includeScript value="/support/console/22.0/integration.js"/>
6    <script type="text/javascript">
7        function testIsInConsole() {
8            if (sforce.console.isInConsole()) {
9                  alert('in console');
10               } else {
11                  alert('not in console');
12            }
13        }
14    </script>
15</apex:page>

This example is set to run by clicking a custom link on a case. For more information, see “Defining Custom Buttons and Links” in the Salesforce online help.

Note

Response

Returns true if the page is in the Salesforce console; false if the page is not in the Salesforce console.