+ Start a Discussion
Mila JohnsonMila Johnson 

Check my trigger.

Hello all,

Need some help on this trigger please. Created a custom setting to bypass user for this trigger.

trigger Deleteaccount on Account (before delete) {
        Automation_Processes__c Automation = Automation_Processes__c.getInstance(UserInfo.getUserId());
    System.debug(' accountdeleteTrigger');
    for(Account acc : trigger.old){
            acc.adderror('Account Cannot be deleted');

Maharajan CMaharajan C
Hi Mike,

There is no problem in your code.

Check your custom setting record... Is it marked as true or false... It should be false then your trigger will bypass...

Maharajan CMaharajan C
Sorry Mila, I mentoned your name wrongly...