LeadConvertResult Class

The result of a lead conversion.

Namespace

Database

Usage

An array of LeadConvertResult objects is returned with the convertLead Database method. Each element in the LeadConvertResult array corresponds to the sObject array passed as the SObject[] parameter in the convertLead Database method, that is, the first element in the LeadConvertResult array matches the first element passed in the SObject array, the second element corresponds to the second element, and so on. If only one sObject is passed in, the LeadConvertResult array contains a single element.

LeadConvertResult Methods

The following are methods for LeadConvertResult. All are instance methods.

getAccountId()

The ID of the new account (if a new account was specified) or the ID of the account specified when convertLead was invoked.

Signature

public ID getAccountId()

Return Value

Type: ID

getContactId()

The ID of the new contact (if a new contact was specified) or the ID of the contact specified when convertLead was invoked.

Signature

public ID getContactId()

Return Value

Type: ID

getErrors()

If an error occurred, an array of one or more database error objects providing the error code and description.

Signature

public Database.Error[] getErrors()

Return Value

Type: Database.Error[]

getLeadId()

The ID of the converted lead.

Signature

public ID getLeadId()

Return Value

Type: ID

getOpportunityId()

The ID of the new opportunity, if one was created when convertLead was invoked.

Signature

public ID getOpportunityId()

Return Value

Type: ID

isSuccess()

A Boolean value that is set to true if the DML operation was successful for this object, false otherwise

Signature

public Boolean isSuccess()

Return Value

Type: Boolean