Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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

getRelatedPersonAccountId()

The ID of the new or existing person account specified when convertLead was invoked.

Signature

public ID getRelatedPersonAccountId()

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