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
gokubigokubi 

ajax convertlead problem

i'm trying to do lead conversion from the ajax api. Here's my function:

function convertlead(LeadID) {
//Convert lead
var qr = sforceClient.Query("Select Id From Lead Where Id = '" + LeadID + "'");
var lead = qr.records[0];

ContactID = sforceClient.ConvertLead(lead);

}

I get this error:

Error on line 384 of document https://sandbox.sforce.com/ajax/beta2/sforceclient.js: leadConverts.toSoap is not a function

Any thoughts on what I'm doing wrong?



UPDATE: I figured out I need to create a LeadConverts object to pass to ConvertLead. If anyone has a sample of this at their fingertips, I'd be much obliged. Thanks!



Thanks,
Steve

Message Edited by gokubi on 11-23-2005 06:57 AM

ywangywang

I met the same problem now.

It seems that ajax toolkit has no function to convert lead.

Different from Web Services API ,according to the manual office toolkit doesn't support ConvertLead API Call.  

So I suggested my custome to create account,contact,opportunity with AJAX and use custome fields to identify whether a lead has been converted or not logically.

 

gokubigokubi
Actually, you can do lead conversion via the AJAX api. See my rapid lead converter for a fairly complex example.

Steve