Skip to main content
1-Visitor
November 20, 2017
Solved

How to "Show Error Notifications" from a service?

  • November 20, 2017
  • 3 replies
  • 3804 views

Hi. Under each service -> configure service, we have the option to "show success notifications" and "show error notifications". Underneath the latter's message box, it says "Note: include the string [server-message] to include the response from the server". Where exactly do I add this? I assume I can use this for displaying an error message kicked by from my service.

For example, I have two services:

A service that updates a field name in a MS SQL table. If SQL kicks back a message, I would like to display this to the end user.

For the other service, it returns an infotable and I use this infotable to fill a grid. I'm not sure where I would include this message without making my resultset a nested infotable, but that typically screws with the selected row functionality.

Thanks ahead for the knowledge sharing!

Michael

Best answer by AdamR

Hi Michael,

The success notification can only show a single value (by default it's "Success"), it will not show any message returned from the service.  While the error message can show what is returned as an error from the service.  You can customize this in the service itself using a try -> catch, then a throw statement to send the text you want to return.

Thanks,
Adam

3 replies

AdamR14-AlexandriteAnswer
14-Alexandrite
November 20, 2017

Hi Michael,

The success notification can only show a single value (by default it's "Success"), it will not show any message returned from the service.  While the error message can show what is returned as an error from the service.  You can customize this in the service itself using a try -> catch, then a throw statement to send the text you want to return.

Thanks,
Adam

1-Visitor
November 21, 2017

Thanks Adam. Took some testing, but I think I understand how that option for services in the data panel to "show error notifications" works now. For a moment I thought the statement "Note: include the string [server-message] to include the response from the server" meant include it from the Error object's message.. but it literally meant have [server-message] in the box and that gets replaced with the error's message.