You need to sign in to do that
Don't have an account?

adderror in trigger
Here is my simple before delete trigger code: I want to display this custom message from adderror but in the standard page, I'm getting system exception message. Why is my custom adderror message not showing up on my standard contact page?
trigger contactinsertTrigger on Contact (before insert)
{
for (Contact c: Trigger.new)
{
c.addError('Contacts cannot be added');
}
}
trigger contactinsertTrigger on Contact (before insert)
{
for (Contact c: Trigger.new)
{
c.addError('Contacts cannot be added');
}
}
Trigger is before insert and will work while inserting a contact and will show error msg.