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

Simple Ajax Login Question


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.

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:

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

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.
Thanks so much Michael!

Thats exactly the info I needed.