Skip to content
DB.DBResultItem

DB.DBResultItem

The forvendi.DB.DBResultItem class encapsulates the execution result, associated record reference, and potential errors for an individual SObject record or email message processed during database operations.


Properties

record

Reference to the SObject record processed during the DML operation.

Signature:

public SObject record

errors

List of standard Salesforce Database.Error instances describing validation, trigger, or system issues.

Signature:

public List<Database.Error> errors

sendErrors

List of Messaging.SendEmailError instances associated with failed email delivery attempts.

Signature:

public List<Messaging.SendEmailError> sendErrors

hasErrors

Indicates whether the operation failed for this specific record or email item.

Signature:

public Boolean hasErrors

Return Value: Booleantrue if processing errors exist, false otherwise.


Constructors

public DBResultItem()
public DBResultItem(SObject record)
public DBResultItem(SObject record, Database.Error[] errors)
public DBResultItem(Messaging.SendEmailError[] errors)

Parameters:

  • record: The target SObject record instance.
  • errors: Array of Database.Error or Messaging.SendEmailError objects.

addError(String message)

Manually adds a custom error message string to the result context for this record.

Signature:

public void addError(String message)

Parameters:

  • message: Error message description to append.

getErrorMessage()

Retrieves a semicolon-separated string concatenating all error messages from both Database.Error and Messaging.SendEmailError collections.

Signature:

public String getErrorMessage()

Return Value: String – Semicolon-delimited error string (";").