cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

How to "Show Error Notifications" from a service?

mfgpartner
11-Garnet

How to "Show Error Notifications" from a service?

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

1 ACCEPTED SOLUTION

Accepted Solutions
AdamR
12-Amethyst
(To:mfgpartner)

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

View solution in original post

3 REPLIES 3
AdamR
12-Amethyst
(To:mfgpartner)

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

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.

Hi Adam - Is there a way to only show the error message (dynamic) that I'd like to show instead of the complete chain of services that were called? For example:

Server-Message.png

"Test error message" is the exact message that my SQL stored procedure is kicking back. This message would typically be something more specific, i.e., "Work Order ##### cannot be created as it already exists." I would like the end user to see that only instead of the complete service stack trace.

Top Tags