You need to sign in to do that
Don't have an account?
DTRain521
Display a message from a trigger
Hello,
What would be the best way to display a message while a trigger runs on a Lead before insert or update? Preferably I would like to have a message display that provides a decision of yes or no. Yes would return them to the lead record to make other updates, no would save the record.
Any help to point me in the right direction would be great. Code reference would be great. It seems I learn better from existing code. :)
Thanks Dwayne
Triggers can not accomplish this. Triggers exeucte at the database level, they do not interact with the UI. The only information you can pass back to the UI via a Trigger are error messages via the Sobject.addError(string) method.
For your use case, you will probably need to use Visualforce / Apex Controllers & Extensions. Take a look at the dev guide here ( http://www.salesforce.com/us/developer/docs/pages/index.htm ) . That provides examples on how to create custom VF Pages / Controllers which would allow you to implement your use case.
You may be able to accomplish this with some creative Custom Buttons / Javascript also. But you cannot do this inside Triggers.
All Answers
Triggers can not accomplish this. Triggers exeucte at the database level, they do not interact with the UI. The only information you can pass back to the UI via a Trigger are error messages via the Sobject.addError(string) method.
For your use case, you will probably need to use Visualforce / Apex Controllers & Extensions. Take a look at the dev guide here ( http://www.salesforce.com/us/developer/docs/pages/index.htm ) . That provides examples on how to create custom VF Pages / Controllers which would allow you to implement your use case.
You may be able to accomplish this with some creative Custom Buttons / Javascript also. But you cannot do this inside Triggers.
I had a feeling that I would need to look into such a solution.
Thank you for your advice. Gets me going in the right direction.