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
Iceman123Iceman123 

Throwing info type messages from apex triggers

hi there,

 

I have a simple question.  I know how to throw errors from apex triggers by using the sObject.addErrors method.  This gets displayed on the UI as a red error message.   Is there a way to throw info level messages that show up as a non-critical message?  Or will I have to write something custom like set the info messages in a field from the trigger and display that field in a info message section on the UI?

 

thx,

Pi

mohimohi

 

trigger validation on Account (before insert) {
list<account> acct=[select name from account where name=:trigger.new[0].name];
if(acct.size()>0)
{trigger.new[0].Name.addError('not a valid account');
}
}
Iceman123Iceman123

Thanks. I know how to use addError, was wondering if there's a similar method such as addInfo that displays a message at the top of the page as an INFO level statement and does not cause an error condition in the trigger.

Falcon81Falcon81

Hi.

 

Where you able to solve this issue? I'm having the same dificulty here. Thanks

revanth adminrevanth admin
Hi


I Need The Same Requirement Hear If you able to solve the problem?

Respond...

Thanks