1

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.

~Vasu

4

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.

| improve this answer | |
0

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")
        button2Alert.show()
                    }, completeBlock: { success in
            print(success)

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

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.