How to handle button disable + error message when service fails in Mashup?
Hi everyone,
I have a mashup setup with a popup where user can create a new entry.
When the button on this popup is clicked, it first creates a new entry in the database through a ThingWorx service.
Once the service completes successfully, a new popup opens where the user continues the process.
The issue I observed is that some users click the button multiple times, because the service execution takes around 1–2 seconds before the new popup appears — this causes multiple duplicate entries in the database.
To fix this, I changed the logic so that the button is disabled immediately after the first click, and it is only re-enabled after the service is complete.
This works well when everything runs fine.
However, I now have one new issue:
If the service fails (e.g., timeout, backend issue, or validation error), the button remains disabled forever, since I am only using the “ServiceInvokeCompleted” event.
My question:
Is there a way in ThingWorx Mashup to detect service failure or exception so that I can:
-
Re-enable the button if the service fails, and
-
Show an error message like “An error occurred while creating the entry. Please try again.”
I’m currently using ServiceInvokeCompleted, but it doesn’t distinguish between success and failure.
Should I use ServiceInvokeReturned or any other approach?
How do you usually handle this scenario in ThingWorx Mashups to avoid disabled buttons and duplicate entries?
I am already examining why entry creation is not happening instantly. Why this delay is coming there which gives user a chance to manipulate this in a bad way.
Thanks in advance!

