[SalesForce] How to disable “Error: Invalid Data” in trigger error message

I have a trigger in which error message is getting displayed in a standrad page using adderror method.Which gives an error

Error: Invalid Data. Review all error messages below to correct your
data.

I want to disable this message and only need to display my customize message.

Is it possible?

Best Answer

Try this

for(Session__c sNew : trigger.new)
{
   sNew.addError('Overlap Session');

}
Related Topic