You need to sign in to do that
Don't have an account?
SF DEV
How to display message on insert.
I have a trigger which calls a class method, now inside the class i need to send message.
Eg:
Trigger: calling class Testclass
class: Testclass(){
if(somecondition)
{
from here i want pass messsage to trigger.
}
You can return some specifc values for particular error condition. then accordintg to the return value you can add the suitable error using addError.
Hit the Kudos button if any post helps you - Mark the answer as solution, It might help others running to into similar problem in future.
All Answers
Hi
If you are trying to throw an error to the detail page like "insert successful" or any type of error message
Then you can use
Trigger.addError('your msg');
If this is not the case can you elaborate a bit that why you need to send a msg to the trigger..!
You can return some specifc values for particular error condition. then accordintg to the return value you can add the suitable error using addError.
Hit the Kudos button if any post helps you - Mark the answer as solution, It might help others running to into similar problem in future.
f you got the answer from this post, Please hit the Kudos button
Thanks Chamil.