function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pramod sharma 15pramod sharma 15 

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');
     }
}
Balaji BondarBalaji Bondar
Hi Pramod,

Trigger is before insert and will work while inserting a contact and will show error msg.
pramod sharma 15pramod sharma 15
sorry, my description is confusing...I did try insert trigger only..but its not showing adderror message :(