You need to sign in to do that
Don't have an account?
trigger prevent Delete parent object
i
i have a trigger after delete
but it is not doing anything
i have 2 custom objects
Vacante__c and Asignados __c
on the Asignados__c ithere is a master detail to the Vacante__c
i want to check when i want to delete a Record of Vacante__c if there are/is someone record Asignados__c that is related to my record that i want to delete
trigger deleteVacante on Vacante__c (before delete) {
for(Vacante__c vac1 : Trigger.old){
Vacante__c vac=[Select v.Id From Vacante__c v WHERE v.Id=:vac1.Id];
String idvac=vac.Id;
Asignados__c con = [Select a.Vacante__c From Asignados__c a WHERE a.Vacante__c=:idvac];
if(con==null)
delete con;
}
}
also prove this but the result is the same nothing ,delete the record