Newer Version Available
getPageInfo()
Returns page information for the specified tab after its
content has loaded. If the tab ID is null, it returns page information for the enclosing
primary tab or subtab. Note that to get the page information from a custom console
component, a tabId must be passed as the first
parameter to this method.This method is only available in
API version 26.0 or later.
Syntax
1sforce.console.getPageInfo(tabId:String, (optional)callback:Function)Arguments
| Name | Type | Description |
|---|---|---|
| tabId | string | ID of the tab from which page information is returned. |
| callback | function | JavaScript method that’s called upon completion of the method. |
Sample Code–Visualforce
1<apex:page>
2 <A HREF="#" onClick="testGetPageInfo();return false">
3 Click here to get page information</A>
4
5 <apex:includeScript value="/support/console/60.0/integration.js"/>
6 <script type="text/javascript">
7 function testGetPageInfo() {
8 //Get the page information of 'scc-pt-1'
9 //This value is for example purposes only
10 var tabId = 'scc-pt-1';
11 sforce.console.getPageInfo(tabId , showPageInfo);
12 }
13
14 var showPageInfo = function showPageInfo(result) {
15 alert('Page Info: ' + result.pageInfo);
16 };
17 </script>
18</apex:page>Response
This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following fields:
| Name | Type | Description |
|---|---|---|
| pageInfo | string | Returns the URL of the current page as a JSON string, and
includes any applicable object ID, object name, object type, and for
API version 33.0 or later, the object tab name. For example:
|
| callback | function | JavaScript method that’s called upon completion of the method. |