Table of Contents


Lead Conversion (Native)

Convert native leads programmatically to Account, Contact and Opportunity.
 

var convertSettings = new LeadConvertSettings {
    LeadId =  model.LeadId,
    ContactId = model.ContactId,
    AccountId = model.AccountId,
    OwnerId = SystemInfo.UserId,
    DoNotCreateOpportunity = model.DonotCreateOpp,
    ConvertStatus = "Closed - Converted",
    OpportunityName = "ACME - BM200",
    IsOverWriteLeadSource = false,
    IsSendEmailNotification = true,
    OpportunityRecordTypeId = "PXS3242342343453"
};

var result = LeadConverter.Convert(convertSettings);

//result has the following properties:
{
    string      LeadId
    string      ContactId
    string      AccountId
    string      OpportunityId
    bool        IsSuccess
    List<Error> Errors
}