How get trigger error message to display on screen (show error for end user) If I create after update trigger which have business logic to issue call REST outside service. And if I got response 500 (Internal Server Error). How can I bring those response message to show to user on screen. Thank you. Tawatchai.
How get trigger error message to display on screen (show error for end user)
If I create after update trigger which have business logic to issue call REST outside service.
And if I got response 500 (Internal Server Error). How can I bring those response message to show to user on screen.
if its a synchronous trigger, errors thrown by triggers are shown in UI.
What is the type of trigger you are using ?
For HTTP triggers we have a checkbox that says
" Throw Exception if server returns code out of range 200 - 210"
i have the same question.
in my case it is a objectscript trigger.
For now im setting the object status to previous status and filling a field with error information.
it would be great to show a message to the end-user.
Thank you in advance,
I also have the need to display a UI message from my object script trigger.
Thanks for letting us know the solution.
As stated by Anoop above, you can throw an exception from your ObjectScript trigger. This will halt trigger execution and user will be re-directed to an error page and error details will be displayed.
throw 'Field Update failed due to .... ';//some error description that will be shown to end-user
Thank you for your idea.
However I need to warn the user without stopping the execution of the script.
If I "throw" an error it will stop the execution and will not "commit" the changes.
I only want to warn the user.
It would be nice to have a server-side version of "rbf_growl()" or an easy way to invoke it from the server-side.
In this case you should consider using Validate Record Scipt trigger. It can be configured as 'Ignorable' i.e. 'Treat this trigger as a Warning option', wherein user will be prompted about the error, however, he may choose to proceed with the execution.
For more details:
We need to understand here that scripts that are evaluated on server-side do not have client-side API functions like rbf_growl. Any user interaction has to be embedded within a request/response cycle, which is presently available as part of Validation script triggers.