You need to sign in to do that
Don't have an account?
Mila 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());
if(!Automation.Bypass_Account_Deletion_trigger__c){
return;
}
System.debug(' accountdeleteTrigger');
for(Account acc : trigger.old){
acc.adderror('Account Cannot be deleted');
}
}
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());
if(!Automation.Bypass_Account_Deletion_trigger__c){
return;
}
System.debug(' accountdeleteTrigger');
for(Account acc : trigger.old){
acc.adderror('Account Cannot be deleted');
}
}
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...
Thanks,
Maharajan.C