I am builiding an IOS mobile app ( native app ) which creates a Lead using the salesforce mobile SDK (IOS). I could not find an API to convert a lead to a contact like how you can do in Apex. Any one has any ideas on how to do this. Eventually i want to convert a Lead to a contact and create an task from the mobile app itself. Thanks in advance.



You can convert a lead through the SOAP API. Check out ZKSforce, an Objective-C wrapper around the SOAP API. I contributed some async block methods that make this very easy.


Write this code inside of leadConvert Func

    let leadConvertObj = ZKLeadConvert()
    leadConvertObj.leadId = leadId;
    leadConvertObj.convertedStatus = leadStatus;
    leadConvertObj.doNotCreateOpportunity = checkButton
    if !checkButton {
        leadConvertObj.opportunityName = self.opporchunityText.text
    if let _ = accointInfo {
        leadConvertObj.accountId = accointInfo!["Id"] as? String

    client?.performConvertLead([leadConvertObj], failBlock: { exp in
        let button2Alert: UIAlertView = UIAlertView(title: "Error", message: "Lead Status Picklist Values is not Converted",
            delegate: self, cancelButtonTitle: "Ok")
                    }, completeBlock: { success in

            let result = success.last as? ZKLeadConvertResult
            print(result?.accountId )
            print(result?.contactId )
            print(result?.opportunityId )
            print(result?.leadId )

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.