I'm trying to undelete records using apex and it is throwing me an error: entity is deleted
List<MyObject__c> undeleteObj = [select id, Unique_Id__c from MyObject__c where Unique_Id__c IN :uniqueIds]; undelete undeleteObj;
This code is in the trigger on after update. Schema is same, record does exists in org and I verified it in Real Force. I can't do this using data loader since it is part of workflow process where the record is undeleted if it was previously deleted else or a new record is added. Any suggestions/workarounds will be appreciated.