Skip to main content
deleted 234 characters in body
Source Link
Satya
  • 754
  • 5
  • 23
  • 45

<apex:page showHeader="false">

.rTable{ display: table;}
<apex:page showHeader="false">
<style type="text/css">
.rTable { display: table; }
    </style>

    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/37.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {

      var state = { //state that you need when the callback is called
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          onSuccess: layoutResults,

          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select UsersId, UserType,IsCurrent,users.name From AuthSession ",
           callback);
  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
        var records = queryResult.getArray('records');
        for (var i = 0; i < records.length; i++) {
            var user = records[i];

    

}

function queryFailed(error, source) { source.output.innerHTML = "An error has occurred: " + error; }

function layoutResults(queryResult, source) { if (queryResult.size > 0) { var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var user = records[i];

        var tr = document.createElement("tr");
            tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
            document.getElementById("myTable").appendChild(tr);         
        }
        source.output.innerHTML = output;
    }
}

  </script>

    

}

<html>
<table id="myTable">
    <!-- Header -->
    <tr>
        
        <td> Id </td>
        
        <td> Name </td>
        <td> iscurrent</td>
    </tr>
</table>
</html>
</apex:page>
IdNameiscurrent
<apex:page showHeader="false">
<style type="text/css">
.rTable { display: table; }
    </style>

    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/37.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {

      var state = { //state that you need when the callback is called
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          onSuccess: layoutResults,

          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select UsersId, UserType,IsCurrent From AuthSession ",
           callback);
  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
        var records = queryResult.getArray('records');
        for (var i = 0; i < records.length; i++) {
            var user = records[i];

            var tr = document.createElement("tr");
            tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
            document.getElementById("myTable").appendChild(tr);         
        }
        source.output.innerHTML = output;
    }
}

  </script>

    <html>
<table id="myTable">
    <!-- Header -->
    <tr>
        
        <td> Id </td>
        
        <td> Name </td>
        <td> iscurrent</td>
    </tr>
</table>
</html>
</apex:page>

<apex:page showHeader="false">

.rTable{ display: table;}
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/37.0/connection.js"
      type="text/javascript"></script>
<script type="text/javascript">     window.onload = setupPage;
function setupPage() {

  var state = { //state that you need when the callback is called
      output : document.getElementById("output"),
      startTime : new Date().getTime()};

  var callback = {
      onSuccess: layoutResults,

      onFailure: queryFailed,
      source: state};

  sforce.connection.query(
      "Select UsersId, UserType,IsCurrent,users.name From AuthSession ",
       callback);

}

function queryFailed(error, source) { source.output.innerHTML = "An error has occurred: " + error; }

function layoutResults(queryResult, source) { if (queryResult.size > 0) { var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var user = records[i];

        var tr = document.createElement("tr");
        tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
        document.getElementById("myTable").appendChild(tr);         
    }
    source.output.innerHTML = output;
}

}

<html>
IdNameiscurrent
formatted
Source Link
highfive
  • 6.3k
  • 3
  • 32
  • 58

<apex:page showHeader="false">

.rTable{ display: table;}
<apex:page showHeader="false">
<style type="text/css">
.rTable { display: table; }
    </style>

    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/37.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {

      var state = { //state that you need when the callback is called
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          onSuccess: layoutResults,

          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select UsersId, UserType,IsCurrent From AuthSession ",
           callback);

}

function queryFailed(error, source) { source.output.innerHTML = "An error has occurred: " + error; }

function layoutResults(queryResult, source) { if (queryResult.size > 0) { var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var user = records[i];

  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
        var records = queryResult.getArray('records');
        for (var i = 0; i < records.length; i++) {
            var user = records[i];

            var tr = document.createElement("tr");
            tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
            document.getElementById("myTable").appendChild(tr);         
        }
        source.output.innerHTML = output;
    }

}

}

  </script>

    <html>
<table id="myTable">
    <!-- Header -->
    <tr>
        
        <td> Id </td>
        
        <td> Name </td>
        <td> iscurrent</td>
    </tr>
</table>
</html>
</apex:page>
IdNameiscurrent

<apex:page showHeader="false">

.rTable{ display: table;}
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/37.0/connection.js"
      type="text/javascript"></script>
<script type="text/javascript">     window.onload = setupPage;
function setupPage() {

  var state = { //state that you need when the callback is called
      output : document.getElementById("output"),
      startTime : new Date().getTime()};

  var callback = {
      onSuccess: layoutResults,

      onFailure: queryFailed,
      source: state};

  sforce.connection.query(
      "Select UsersId, UserType,IsCurrent From AuthSession ",
       callback);

}

function queryFailed(error, source) { source.output.innerHTML = "An error has occurred: " + error; }

function layoutResults(queryResult, source) { if (queryResult.size > 0) { var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var user = records[i];

        var tr = document.createElement("tr");
        tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
        document.getElementById("myTable").appendChild(tr);         
    }
    source.output.innerHTML = output;
}

}

<html>
IdNameiscurrent
<apex:page showHeader="false">
<style type="text/css">
.rTable { display: table; }
    </style>

    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/37.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {

      var state = { //state that you need when the callback is called
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          onSuccess: layoutResults,

          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select UsersId, UserType,IsCurrent From AuthSession ",
           callback);
  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
        var records = queryResult.getArray('records');
        for (var i = 0; i < records.length; i++) {
            var user = records[i];

            var tr = document.createElement("tr");
            tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
            document.getElementById("myTable").appendChild(tr);         
        }
        source.output.innerHTML = output;
    }
}

  </script>

    <html>
<table id="myTable">
    <!-- Header -->
    <tr>
        
        <td> Id </td>
        
        <td> Name </td>
        <td> iscurrent</td>
    </tr>
</table>
</html>
</apex:page>
Source Link
Satya
  • 754
  • 5
  • 23
  • 45

getting the all logged in users using ajax

<apex:page showHeader="false">

.rTable { display: table; }
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/37.0/connection.js"
      type="text/javascript"></script>
<script type="text/javascript">     window.onload = setupPage;
function setupPage() {

  var state = { //state that you need when the callback is called
      output : document.getElementById("output"),
      startTime : new Date().getTime()};

  var callback = {
      onSuccess: layoutResults,

      onFailure: queryFailed,
      source: state};

  sforce.connection.query(
      "Select UsersId, UserType,IsCurrent From AuthSession ",
       callback);

}

function queryFailed(error, source) { source.output.innerHTML = "An error has occurred: " + error; }

function layoutResults(queryResult, source) { if (queryResult.size > 0) { var records = queryResult.getArray('records'); for (var i = 0; i < records.length; i++) { var user = records[i];

        var tr = document.createElement("tr");
        tr.innerHTML = '<td>' + user.UsersId + '</td>' + '<td>' + user.UserType  + '</td>'+ '<td>' + user.IsCurrent + '</td>';
        document.getElementById("myTable").appendChild(tr);         
    }
    source.output.innerHTML = output;
}

}

<html>
Id Name iscurrent

i tried to get all the logged in users,,am getting ids ,i also want to display the names.need help to meet this.thanks in advance