I've finally achieved Logging into my Salesforce Sandbox using the C# program i wrote in VS2013. Now im tweaking some things and i'm still new at this.

Basically my question is, How do i Pull already created users from the sandbox to my program and put each user in my List box?

the code i have currently doesnt do a whole lot and i cant find any other tutorials or code i can use.

        SforceService Sfdcbinding = null; 
        Lead updateLead = new Lead();

        updateLead.Id = Id;
        string newEmailAddress = txtEmail.Text;
        string newLastName = txtLastName.Text;
        updateLead.Email = newEmailAddress;
        updateLead.LastName = newLastName;

        SaveResult[] saveResults = Sfdcbinding.update(new sObject[] { updateLead });
  • I downvoted your question as there's a lot guides out there about accessing data with salesforce APIs in c# (SOAP in your case as I can see). All you have to do is perform query on User object and maybe cast the result from sObject to User type. – Bart Juriewicz Feb 24 '15 at 21:38
  • No idea how to do that. I havn't programmed in over a year.. (use it or lose it type thing) Got any examples? – Jonathan Feb 24 '15 at 21:55
up vote 0 down vote accepted

I cannot specifically give detailed instructions in C# but here is you would do that in general.

  1. You will first need to login to Salesforce using user's credentials (You can use Partner Soap API login operation to do that).

  2. Construct a SOQL query to get the list of users of your liking (you can query the data using Partner API or Salesforce REST API).

  3. Parse the response, extract the user fields you looking for and populate the List box in the UI.

  • This is exactly what i had to do. Thanks. – Jonathan Feb 25 '15 at 15:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.