function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
peekpeek 

Simple Ajax Login Question

Greetings,

I'm creating some custom buttons to automate constantly repeated actions at my work.  For example, a voicemail buttons which saves you the trouble of creating a task, linking it up, filling in "Left vm" for the subject. The button does all that for you in 1 click.

I'm using javascript through the API to create the records in our database.

My question:
How do you insert the user's login and password into the login call
sforce.connection.login(login , password);
Up to now, I've just used my own login/pw to design and test the system.
I would think there might be a pw mergefield, but I can't seem to find it.

Thanks,
Dave
Michael SnowMichael Snow
I may have misunderstood your question, but I think you are trying to log in via an S-Control.  If so, then you are in luck because you don't need to.  Just use:

<html>
<head>
<script src="/soap/ajax/9.0/connection.js" type="text/javascript"></script>
<script>
function init()
{
   //something useful in here
}
</script>
</head>
<body onload="init();">
</body>
</html>

Once you include the connection.js you are all set to use the Ajax connection.  All calls will be made via the logged-in user that executes the S-Control, so be aware of read/write restrictions.
peekpeek
Thanks so much Michael!

Thats exactly the info I needed.