How i deleted parent account (which caused related event or task records deleted itself): I've run a batch, which do dml and send other sobject records to be dml in other batch from finish. I had to update the event and task records to assign a different parent account but the batch(failed) and finish continued to run another batch to delete their parent account(succeeded).
- I used the Dynamic dml [Database.update(activitiesToUpdate, true) and Database.delete(accountsToDelete, true)]
I'm able to query those task and event records deleted implicitly with following soql
List<Task> tsks = [select id from task where isDeleted=true all rows];
but unable to undelete them
undelete tsks; //throws an error that Those task record doesn't exist in recycle bin
FYI: i don't want to undelete parent account records, if it is required to undelete them can we remove the parent account id from record and then undelete, is this possible?