You need to sign in to do that
Don't have an account?
Elad Kaplan 3
Login to salesforce using connection.js
Does anybody has a working example that uses the connection.login.js ?
I'm trying to connect to salesforce from an exterior website using javascript and getting an Error.
Here is My code:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<script src="https://na6.salesforce.com/soap/ajax/30.0/connection.js" ></script>
<script type="text/javascript" >
function logincall()
{
try{
var usrname = document.getElementById('userid').value;
var passwrd = document.getElementById('passid').value;
if(usrname == null || usrname == '' || passwrd == null || passwrd == '')
{
alert('Please enter Username AND Password');
return;
}
var result = sforce.connection.login(usrname, passwrd);
alert("Logged in with session id " + result.sessionId);
}
catch(error)
{
alert(error);
}
}
</script>
</HEAD>
<BODY>
To test logging into a Salesforce Instance using the connection.js "login" call
<table>
<tr>
<td>Username</td>
<td><input type="text" id="userid" value="" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" id="passid" value="" /></td>
</tr>
</table>
<input type="button" value="Login" onclick="logincall();" />
</BODY>
</HTML>
I'm getting an Error : The requested url services/Soap/u/30.0 was not found on this server
Any idea anyone?
I'm trying to connect to salesforce from an exterior website using javascript and getting an Error.
Here is My code:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<script src="https://na6.salesforce.com/soap/ajax/30.0/connection.js" ></script>
<script type="text/javascript" >
function logincall()
{
try{
var usrname = document.getElementById('userid').value;
var passwrd = document.getElementById('passid').value;
if(usrname == null || usrname == '' || passwrd == null || passwrd == '')
{
alert('Please enter Username AND Password');
return;
}
var result = sforce.connection.login(usrname, passwrd);
alert("Logged in with session id " + result.sessionId);
}
catch(error)
{
alert(error);
}
}
</script>
</HEAD>
<BODY>
To test logging into a Salesforce Instance using the connection.js "login" call
<table>
<tr>
<td>Username</td>
<td><input type="text" id="userid" value="" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" id="passid" value="" /></td>
</tr>
</table>
<input type="button" value="Login" onclick="logincall();" />
</BODY>
</HTML>
I'm getting an Error : The requested url services/Soap/u/30.0 was not found on this server
Any idea anyone?
I think you are missing this line:
{!requireScript("/soap/ajax/30.0/connection.js")}
How to solve above problem in javascript code outside salesforce envrionment please give me some idea or code to solve above problem because i am facing same problem in creating chrome extension .
Thanks in Advance.