You need to sign in to do that
Don't have an account?
muthu.swi
Apex: Getting a weird error while deleting a record
Hi
I have two entities Master and detail with no relationship. So, when I delete master I am deleting the detail reocords in Before Delete trigger. And, my code in the trigger is simple as:
if (Trigger.isDelete && Trigger.isBefore)
{
for (Master__c master : Trigger.old)
{
Detail__c[] details = [Select Id from Detail__c Where Master__c = :master.Id];
delete details;
}
}
{
Detail__c[] details = [Select Id from Detail__c Where Master__c = :master.Id];
delete details;
}
}
But I am getting this error when I delete the master record..
System.Exception: ORA-01086: savepoint 'ORACLE_SVPT_3108' never established
Could anyone help fix this? Thanks in advance.
Muthu
if so, it may be a bug, can you file a detailed bug report.
thanks for reporting this.
If there is no relationship then is Detail__c.Master__c a text field where you are putting the Id value for the Master__c object?
Finally, you do know that this code will not survive the governor limits if you ever try to delete 21 Master__c records through the API, right?