How get trigger error message to display on screen (show err

Posted by tawatchai on 23-Mar-2016 10:00

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.

All Replies

Posted by Anoop Premachandran on 24-Mar-2016 10:09

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"

Posted by Jorrit on 08-Jun-2016 13:37

Hi Anoop,

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,

Regards Jorrit

Posted by claudemlandry on 24-Jun-2016 11:45

I also have the need to display a UI message from my object script  trigger.

Thanks for letting us know the solution.

Regards, Claude

Posted by Mohammed Siraj on 27-Jun-2016 02:47

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.

Eg:

if(errorCondition){

 throw 'Field Update failed due to .... ';//some error description that will be shown to end-user

}

Posted by claudemlandry on 01-Jul-2016 22:20

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.

Regards, Claude

Posted by Mohammed Siraj on 03-Jul-2016 22:57

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:

documentation.progress.com/.../

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.

This thread is closed