I want to see the records that are failed via Database.UpsertResult. Need to check the error Message and Some required field values like Case Subject, Description other custom fields
Schema.SObjectField f = Case.Ticket_Number__c;
Database.UpsertResult [] cr = Database.upsert(toBeUpsertCases, f, false);
for(Database.upsertResult result:cr) {
if (!result.isSuccess()){
string error = result.getId() + ',' + ' CASE ' + ',' + result.getErrors() + '\n';
System.debug(error);
}
}
In the code above, "error" is printing null, along with the CASE and error message. I need the values of the fields that were used for assignment to be included in the error message as well.
Can you help me is that possible to get the other field values