2

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

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 May 13 '15 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() – Daniel Ballinger May 13 '15 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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