When the attached code is executed, an error is thrown on the controller.saveData() method. This is because the primary key has a duplicate value.
Instead of going to the catch block, servoy displays an messagebox with an error on the screen. The method that calls this code thinks it executes okay…
What I want is that the method that calls this code knows that there was an error creating the record! Does anybody know a sollution or work-around for this problem?
TRY and CATCH are Javascript Error Handling objects. When you write Javascript code (and other languages) you use TRY/CATCH to see if there was an error during execution.