You need to sign in to do that
Don't have an account?
Beginner_sforce
Prevent deletion on custom object , using trigger
Hi, I have this really simple code to prevent deletion, but somehow it doesn't work, can someone help me?thx
Code:
trigger subBrandDelete on Sub_Brand__c (before delete) { if (Trigger.isDelete) { for (Sub_Brand__c sb : Trigger.old) { sb.addError('Cannot delete a Sub-Brand with Walls'); } } }
I took out the if statement and it worked in my DE org.