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.
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> 45 <apex:includeScript value="/support/console/68.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 only10 var tabId = 'scc-pt-1';11 sforce.console.getPageInfo(tabId , showPageInfo);12 }1314 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 API version 31.0 and later, invoking this API method on a PersonAccount object returns the following additional information.
accountId or contactId, the associated account or contact ID
personAccount, which is true if the object is a PersonAccount and false otherwise
callback
function
JavaScript method that’s called upon completion of the method.
1{"url":"https://MY_DOMAIN_NAME.my.salesforce.com/001x0000003DGQR",2"objectId":"001x0000003DGQR","objectName":"Acme Person Account",3"object":"Account", "contactId":"003D000000QOMqg", "personAccount":true}