How do you convert a lead to an opportunity from the soap api?


  • I have been able to login and create a lead but how do you convert it to a opportunity?  Sample code would be appreciated.




    Tuesday, January 13, 2009 10:21 PM


All replies

  • Hi,


    Converting a lead to an opportunity (or a contact, an account) is not covered by any API methods exposed by the CRM web services. It is one of the examples where the application layer adds value Smile. In order to convert a lead, you have to simply use Create() method of the crm web service and craete a new opportunity with the value taken from the lead.


    I hope that helps,



    Wednesday, January 14, 2009 1:50 AM
  • Wednesday, January 14, 2009 6:27 PM
  • I think we misunderstood each other. There is no method to convert the lead to opportunity in the SOAP api as it is exposed in the interface (e.g. ConvertLeadToOpportunityRequest or whatever) and the conversion has to be accomplished manually in several steps (e.g. including changing the lead state). You can accomplish it only by using several requests, regardless of the way you do it - either by using two SetStateLeadRequest and InitializeFromRequest or SetStateLeadRequest and a Create message with all the fields from the lead as the properties of the newly created opportunity (as described by me).

    If you use the Moniker class, you can accomplish much more conversions than just the one mentioned, as described here:


    Best regards,


    Wednesday, January 14, 2009 7:31 PM