I have added visualforce page in service cloud console app and the page developed with AngularJS. Facing an issue with to not getting the opened tab id in my angularJS page.

    <apex:page >
      <apex:includeScript value="/soap/ajax/26.0/connection.js"/>  
      <apex:includeScript value="/support/console/25.0/integration.js"/>
      <script type="text/javascript">

       window.onload = function (){
      var currentTabId = '';
      var showTabId = function showTabId(result) {
          //Display the tab ID

          console.log('Tab ID1: ' + result.id);
          currentTabId = result.id;


    <meta charset="utf-8"></meta>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"></meta>

      <div  ng-app="myAngModuleName">
        <div >
          <div ng-view="ng-view"></div>
      <apex:includescript value="{!URLFOR($Resource.myAngStatic, 'scripts/lib.js')}"></apex:includescript>
      <apex:includescript value="{!URLFOR($Resource.myAngStatic, 'scripts/templates.js')}"></apex:includescript>
      <apex:includescript value="{!URLFOR($Resource.myAngStatic, 'scripts/main.js')}"></apex:includescript>

      <c:ngForce ></c:ngForce>

      <script type="text/javascript">
        var app = angular.module('myAngModuleName');

                var currentPageId={
                  Id : currentTabId  ,
                return currentPageId;


in above code I am trying to get selected tab id and passing those id to my angular module by using factory method.

But I am not getting the id, due to the getFocusedPrimaryTabObjectId() is the callback function. Its rendering the tab id after pageload

Please ask me if need any clarification on this and it very helpful if you have any solution for this...



This site is temporarily in read-only mode and not accepting new answers.

Browse other questions tagged .