DB.DBResult
The forvendi.DB.DBResult class serves as an aggregated container representing the consolidated results of DML operations, lead conversions, or email delivery requests processed by the framework.
Properties
hasErrors
Determines whether any errors occurred during the operation.
Signature:
public Boolean hasErrorsReturn Value: Boolean – true if any item in the result encountered an error, false otherwise.
successResult
Holds the list of forvendi.DB.DBResultItem instances that were successfully created, updated, or removed.
Signature:
public List<forvendi.DB.DBResultItem> successResulterrorResult
Holds the list of forvendi.DB.DBResultItem instances that failed during processing.
Signature:
public List<forvendi.DB.DBResultItem> errorResultall
Stores all forvendi.DB.DBResultItem objects returned by the operation (both successful and failed).
Signature:
public List<forvendi.DB.DBResultItem> allConstructors
public DBResult()
public DBResult(SObject[] records, Database.DeleteResult[] result)
public DBResult(SObject[] records, Database.SaveResult[] result)
public DBResult(Messaging.SendEmailResult[] result)
public DBResult(SObject[] records, Database.UpsertResult[] result)
public DBResult(Database.LeadConvert[] records, Database.LeadConvertResult[] result)Parameters:
records: Array of processed SObject orLeadConvertinstances.result: Native Salesforce result array (DeleteResult[],SaveResult[],UpsertResult[],LeadConvertResult[], orSendEmailResult[]).
add(DBResult result)
Appends all entries from another DBResult instance into the current instance’s successResult and errorResult lists.
Signature:
public void add(forvendi.DB.DBResult result)Parameters:
result: TheDBResultobject to be merged.
getErrorMessage()
Concatenates all error messages across all failed items into a single string.
Signature:
public String getErrorMessage()Return Value: String – Error messages separated by newline characters.
getSuccessRecords()
Extracts and returns only the SObject records that were processed successfully.
Signature:
public List<SObject> getSuccessRecords()Return Value: List<SObject> – Array of successfully processed records.
getErrorRecords()
Extracts and returns only the SObject records that encountered processing errors.
Signature:
public List<SObject> getErrorRecords()Return Value: List<SObject> – Array of records that failed processing.