Skip to main content
added 30 characters in body; edited tags
Source Link
Martin Lezer
  • 7.3k
  • 5
  • 27
  • 41

I want my trigger to prevent deletion of Account records, the code doesn't show any error but my AccountAccount records are still being deleted? here is my code

trigger PreventAccountDelete on Account(before delete){ for(Account a :[select Id from Account where Id IN:Trigger.old]) { System.debug('Cant delete'); }

}

trigger PreventAccountDelete on Account(before delete){
    for(Account a :[select Id from Account where Id IN:Trigger.old])
    {
        System.debug('Cant delete');
    }
    
}

I want my trigger to prevent deletion of Account records, the code doesn't show any error but my Account records are still being deleted? here is my code

trigger PreventAccountDelete on Account(before delete){ for(Account a :[select Id from Account where Id IN:Trigger.old]) { System.debug('Cant delete'); }

}

I want my trigger to prevent deletion of Account records, the code doesn't show any error but my Account records are still being deleted? here is my code

trigger PreventAccountDelete on Account(before delete){
    for(Account a :[select Id from Account where Id IN:Trigger.old])
    {
        System.debug('Cant delete');
    }
    
}
Source Link
Kronos
  • 33
  • 1
  • 5

Deletion Trigger not working?

I want my trigger to prevent deletion of Account records, the code doesn't show any error but my Account records are still being deleted? here is my code

trigger PreventAccountDelete on Account(before delete){ for(Account a :[select Id from Account where Id IN:Trigger.old]) { System.debug('Cant delete'); }

}