Sample Code:
trigger AccountTrigger on Account (before delete, before update, before insert, after insert, after update) { if (trigger.isDelete) { for (Account acc : trigger.old) { acc.addError('You cannot delete account records'); } } }
Sample Code:
trigger AccountTrigger on Account (before delete, before update, before insert, after insert, after update) { if (trigger.isDelete) { for (Account acc : trigger.old) { acc.addError('You cannot delete account records'); } } }