DeleteResult Class

Represents the result of a delete operation on an sObject record. The result is returned by the DataSource.deleteRows method of the DataSource.Connection class.

Namespace

DataSource

Usage

A delete operation on external object records generates an array of objects of type DataSource.DeleteResult. Its methods create result records that indicate whether the delete operation succeeded or failed.

DeleteResult Properties

The following are properties for DeleteResult.

errorMessage

The error message that’s generated by a failed delete operation. Recorded with a result of type DataSource.DeleteResult.

Signature

public String errorMessage {get; set;}

Property Value

Type: String

externalId

The unique identifier of a row that represents an external object record to delete.

Signature

public String externalId {get; set;}

Property Value

Type: String

success

Indicates whether a delete operation succeeded or failed.

Signature

public Boolean success {get; set;}

Property Value

Type: Boolean

DeleteResult Methods

The following are methods for DeleteResult.

equals(obj)

Maintains the integrity of lists of type DeleteResult by determining the equality of external objects in a list. This method is dynamic and is based on the equals method in Java.

Signature

public Boolean equals(Object obj)

Parameters

obj
Type: Object
External object whose key is to be validated.

For information about the equals method, see Using Custom Types in Map Keys and Sets.

Return Value

Type: Boolean

failure(externalId, errorMessage)

Creates a delete result indicating the failure of a delete request for a given external ID.

Signature

public static DataSource.DeleteResult failure(String externalId, String errorMessage)

Parameters

externalId
Type: String
The unique identifier of the sObject record to delete.
errorMessage
Type: String
The reason the delete operation failed.

Return Value

Type: DataSource.DeleteResult

Status result of the delete operation.

hashCode()

Maintains the integrity of lists of type DeleteResult by determining the uniqueness of the external object records in a list.

Signature

public Integer hashCode()

Return Value

Type: Integer

success(externalId)

Creates a delete result indicating the successful completion of a delete request for a given external ID.

Signature

public static DataSource.DeleteResult success(String externalId)

Parameters

externalId
Type: String
The unique identifier of the sObject record to delete.

Return Value

Type: DataSource.DeleteResult

Status result of the delete operation for the sObject with the given external ID.