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 recorderrors
List of standard Salesforce Database.Error instances describing validation, trigger, or system issues.
Signature:
public List<Database.Error> errorssendErrors
List of Messaging.SendEmailError instances associated with failed email delivery attempts.
Signature:
public List<Messaging.SendEmailError> sendErrorshasErrors
Indicates whether the operation failed for this specific record or email item.
Signature:
public Boolean hasErrorsReturn Value: Boolean – true 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 ofDatabase.ErrororMessaging.SendEmailErrorobjects.
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 (";").