I have created a trigger in Salesforce :
Trigger myTestDelete_D on Account (before delete)
{
set<ID> ids = Trigger.oldMap.keyset();
myClass.Details('Account','delete',ids);
}
So the steps are I create an account Acct1. I then delete the account , but in the call to myClass.Details I perform a select to the account with the id of the Acct1.
The issue is that the row has already been deleted and hence I get 0 rows. Is there some sort of setting that is required in Salesforce to wait until the trigger has completed before the entity is deleted ?
I can't give you more details because we don't have the code of your "myClass" class but the query should retrieve the Accounts in the before delete trigger execution. I've created myself a trigger and set up some logs. Here are the results after deleting one Account record.
Trigger Code:
System.debug(Trigger.oldMap):
System.debug(Trigger.newMap):
System.debug(deletedAccounts.size()):
So, I would suggest that the problem is probably in the class that is doing the Query as the records are still available for querying in the before delete trigger.