Newer Version Available

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

isInConsole()

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

1<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/65.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>

To see this example in action, click the custom link on a case. For more information, see Define Custom Buttons and Links in Salesforce Help.

Note

Response

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