Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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/68.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.