UpsertResult Class

Represents the result of an upsert operation on an external object record. The result is returned by the upsertRows method of the DataSource.Connection class.

Namespace

DataSource

Usage

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

UpsertResult Properties

The following are properties for UpsertResult.

errorMessage

The error message that’s generated by a failed upsert operation.

Signature

public String errorMessage {get; set;}

Property Value

Type: String

externalId

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

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

UpsertResult Methods

The following are methods for UpsertResult.

equals(obj)

Maintains the integrity of lists of type UpsertResult by determining the equality of external object records 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.

Return Value

Type: Boolean

failure(externalId, errorMessage)

Creates an upsert result that indicates the failure of a delete request for a given external ID.

Signature

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

Parameters

externalId
Type: String
The unique identifier of the external object record to upsert.
errorMessage
Type: String
The reason the upsert operation failed.

Return Value

Type: DataSource.UpsertResult

Status result for the upsert operation.

hashCode()

Maintains the integrity of lists of type UpsertResult 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 that indicates the successful completion of an upsert request for a given external ID.

Signature

public static DataSource.UpsertResult success(String externalId)

Parameters

externalId
Type: String
The unique identifier of the external object record to upsert.

Return Value

Type: DataSource.UpsertResult

Status result of the upsert operation for the external object record with the given external ID.