DBResult
DBResult
hasErrors
Determines if the entire results has any errors.
Signature:
new DB.DBResult().hasErrors;
Return:
True if the errorResult contains errors, false otherwise.
successResult
Stores List of the DBResultItem objects which have neem successfully created/modified/removed.
Signature:
new DB.DBResult().successResult;
errorResult
Stores List of the DBResultItem objects which failed.
Signature:
new DB.DBResult().errorResult;
all
Stores List of the all DBResultItem objects.
Signature:
new DB.DBResult().all;
DBResult()
Default constructor.
Signature:
new DB.DBResult();
DBResult(SObject[] records, Database.DeleteResult[] result)
Constructor for the Database.DeleteResult
Signature:
new DB.DBResult(SObject[] records, Database.DeleteResult[] result);
Parameters:
- records - an array of SObject instances that represent the records that were processed;
- result - an array of Database,DeleteResult instances that represent the results of the delete operation.
DBResult(SObject[] records, Database.SaveResult[] result)
Constructor for the Database.SaveResult
Signature:
new DB.DBResult(SObject[] records, Database.SaveResult[] result);
Parameters:
- records - an array of SObject instances that represent the records that were processed;
- result - an array of Database.SaveResult instances that represent the results of the save operation.
DBResult(Messaging.SendEmailResult[] result)
Constructor for the DBResult class to handle the result of the send email operation.
Signature:
new DB.DBResult(Messaging.SendEmailResult[] result);
Parameters:
- result - an array of Database.SendEmailResult instances that represent the results of sending one or more emails using Messaging.sendEmail() method in Salesforce.
DBResult(SObject[] records, Database.UpsertResult[] result)
Constructor for the Database.UpsertResult
Signature:
new DB.DBResult(SObject[] records, Database.UpsertResult[] result);
Parameters:
- records - an array of SObject which were attempted to be upserted.
- result - an array of Database.UpsertResult objects that represents the results of an upsert operation.
DBResult(Database.LeadConvert[] records, Database.LeadConvertResult[] result)
Constructor for the Database.LeadConvertResult
Signature:
new DB.DBResult(Database.LeadConvert[] records, Database.LeadConvertResult[] result);
Parameters:
- records - an array of Lead records that are to be converted.
- result - an array of Lead conversion result.
add(DBResult result)
Adds all elements from the successResult and errorResult lists of the input DBResult object to the successResult and errorResult lists of the object that calls this method, respectively.
Signature:
new DB.DBResult().add(DBResult result);
Parameters:
- result - the DBResult object whose successResult and errorResult lists will be added
getErrorMessage()
Returns a concatenated string of error messages.
Signature:
new DB.DBResult().getErrorMessage();
Return:
String formed by joining all the error messages with a line break character.
getSuccessRecords()
Returns an array of SObject records that were successful.
Signature:
new DB.DBResult().getSuccessRecords();
Return:
An array of SObject records that were successful.
getErrorRecords()
Returns an array of SObject records that resulted in an error.
Signature:
new DB.DBResult().getErrorRecords();
Return:
An array of SObject records that resulted in an error.