Announcements
Hi,
I have a requirement where, on a clicked method, i have an if condition applied and if the condition is true, it should stop the flow and just show the error message.
The code used was : Throw error("The condition failed");
After debugging, it is going in the if condition and also it is successfully displaying the error, but it is not stopping the flow. The action is being executed. I want to stop the flow/Action from being executed.
Is there any other command I should be using?
Just put your logic when the error doesn't occur. I mean in if check if it is success and write your logic and in else write failing logic like throw error. So if it fails then it will throw error.
Hi,
Please share more info/screenshots on this so that we can see what's going on. Using the "throw error" statement usually stop the process flow but there could be valid reasons why it's continueing. E.g. check if the code is within error handling (try.. catch statement), or perhaps it's within nested error handling.
X++ exception handling
André Arnaud de Cal...
294,060
Super User 2025 Season 1
Martin Dráb
232,858
Most Valuable Professional
nmaenpaa
101,158
Moderator