Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="/soap/ajax/32.0/connection.js" type="text/javascript">
- </script>
- <script>
- window.onload=getsessionid;
- var uid = "************";
- function getsessionid(){
- alert('hi');
- var username = "test@test.com";
- var password = "test@2"
- var result = sforce.connection.login(username,password);
- alert(result.sessionId);
- var q = "SELECT id from user where id='"+uid+"'";
- var u= sforce.connection.query("SELECT id,Accountid from user where id='"+uid+"'");
- var records = u.getArray("records");
- var Cont= sforce.connection.query("SELECT id,Account.id,Record_Type__c from Contract where Account.id='"+records[0].AccountId+"'");
- var contra = Cont.getArray("records");
- var contracttype = contra[0].Record_Type__c;
- alert(contracttype);
- if(contracttype =="*********")
- {
- *********
- }
- }
- </script>
- <title></title>
- </head>
- <body>
- </body>
- </html>
- <HTML>
- <script src="/soap/ajax/32.0/connection.js" type="text/javascript"></script>
- <script>
- window.onload=getsessionid;
- var uid = "************";
- function getsessionid(){
- alert('hi');
- var username = "YOUR USERNAME";
- var password = "PASSWORD+SECURITY TOKEN"
- var result = sforce.connection.login(username,password);
- alert(result.sessionId);
- var q = "SELECT id from user where id='"+uid+"'";
- var u= sforce.connection.query("SELECT id,Accountid from user where id='"+uid+"'");
- var records = u.getArray("records");
- var Cont= sforce.connection.query("SELECT id,Account.id,Record_Type__c from Contract where Account.id='"+records[0].AccountId+"'");
- var contra = Cont.getArray("records");
- var contracttype = contra[0].Record_Type__c;
- alert(contracttype);
- if(contracttype =="*********")
- {
- *********
- }
- }
- </script>
- <HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement