List <Entitlement>
defEntitlement = [SELECT Id, Default_Entitlement__C FROM Entitlement WHERE
Default_Entitlement__C = TRUE];
dsr=database.delete(defEntitlement,true);
for
(Database.SaveResult sr : dsr) {
if
(sr.isSuccess()) {
// Operation was successful, so get the ID of the record that was processed
System.debug('Successfully deleted entitlement. Entitlement ID: ' +
sr.getId());
insertedEntIds.add(sr.getId());
}
else
{
for(Database.Error err : sr.getErrors()) {
System.debug('The following error has occurred.');
System.debug(err.getStatusCode() + ': ' + err.getMessage());
System.debug('Fields that affected this error: ' + err.getFields());
}
}
}
No comments:
Post a Comment