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.

UndeleteResult Class

The result of an undelete DML operation returned by the Database.undelete method.

Namespace

Database

Usage

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

UndeleteResult Methods

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

getErrors()

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

Signature

public Database.Error[] getErrors()

Return Value

Type: Database.Error[]

getId()

Returns the ID of the sObject you were trying to undelete.

Signature

public ID getId()

Return Value

Type: ID

Usage

If this field contains a value, the object was successfully undeleted. If this field is empty, the operation was not successful for that object.

isSuccess()

Returns 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