I am wondering how to use toolkit for .net to create new leads, because most examples I can find on the net are created using wsdl. I want to know what do I need to do before defining lead, hot to define it and how to update it on application.

1 Answer 1


There are examples of creating records using the Force.com Toolkit for .NET in Nothing But .Net – Implementing CRUD Operations.

You will want something like:

public class Lead {
    public string Id { get; set; }
    public string LastName { get; set; }
    public string Company { get; set; }

// ...

// Get the client based on your chosen authentication method
ForceClient client = new ForceClient(instanceUrl, accessToken, apiVersion);

Lead lead = new Lead() { LastName = "Doe", Company = "Acme" };

string newLeadId = await client.CreateAsync("Lead", lead);
  • I am using auth.UsernamePasswordAsync(_consumerKey, _consumerSecret, _username, _password + _securityToken).Wait(); to authenticate, but it crashes saying it has issue with mscorlib.dll, do you have any suggestons?
    – Vilius
    Commented May 13, 2015 at 14:09
  • @Vilius I'd suggest raising a new question with sample code the reproduces the issue. Ideally you should be using the await keyword rather than .Wait() Commented May 13, 2015 at 19:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .