daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5.     <script src="/soap/ajax/32.0/connection.js" type="text/javascript">
  6.     </script>
  7.     <script>
  8.               window.onload=getsessionid;
  9.               var uid = "************";
  10.                    function getsessionid(){
  11.                    alert('hi');
  12.                    var username = "test@test.com";
  13.                    var password = "test@2"
  14.                    var result = sforce.connection.login(username,password);
  15.                    alert(result.sessionId);
  16.                    var q = "SELECT id from user where id='"+uid+"'";
  17.                    var u= sforce.connection.query("SELECT id,Accountid from user       where id='"+uid+"'");
  18.                    var records = u.getArray("records");
  19.                    var Cont= sforce.connection.query("SELECT id,Account.id,Record_Type__c from Contract where Account.id='"+records[0].AccountId+"'");
  20.                    var contra = Cont.getArray("records");
  21.                    var contracttype = contra[0].Record_Type__c;
  22.                    alert(contracttype);
  23.                    if(contracttype =="*********")
  24.                    {
  25.                     *********
  26.                    }
  27.                    }
  28.     </script>
  29.     <title></title>
  30. </head>
  31. <body>
  32. </body>
  33. </html>
  34.      
  35. <HTML>
  36.  <script src="/soap/ajax/32.0/connection.js" type="text/javascript"></script>
  37.           <script>
  38.           window.onload=getsessionid;
  39.           var uid = "************";
  40.                function getsessionid(){
  41.                alert('hi');
  42.                var username = "YOUR USERNAME";
  43.                var password = "PASSWORD+SECURITY TOKEN"
  44.                var result = sforce.connection.login(username,password);
  45.                alert(result.sessionId);
  46.                var q = "SELECT id from user where id='"+uid+"'";
  47.                var u= sforce.connection.query("SELECT id,Accountid from user       where id='"+uid+"'");
  48.                var records = u.getArray("records");
  49.                var Cont= sforce.connection.query("SELECT id,Account.id,Record_Type__c from Contract where Account.id='"+records[0].AccountId+"'");
  50.                var contra = Cont.getArray("records");
  51.                var contracttype = contra[0].Record_Type__c;
  52.                alert(contracttype);
  53.                if(contracttype =="*********")
  54.                {
  55.                 *********
  56.                }
  57.                }
  58.           </script>
  59. <HTML>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top