Hi Servoy developers
To validate a record before inserting it into db, we validate user input in a method hooked to table event ‘onRecordInsert’. If the validation fails, we return false, true otherwise (as mentioned in several topics). Auto save is on.
Now we encounter the following problem (in Servoy 3.5.7 and 4.01):
There is a difference on how the user leaves the record (in the attached solution I always return false in the check):
-
When choosing alt + arrow down, everything works as expected: The selected record does not change. The user has to enter valid data before the record can be left.
-
Using the mouse or using the arrow down: The selected record changes and leaves the edited record in an unsaved and invalid state which leads to errors. Unless I reselect it and delete the new record.
Does anybody else encounter the same problem (I cannot believe we are the only ones)? We cannot force the user to always use ‘alt + arrow down’ to select an other record. Shouldn’t Servoy behave the same in the three situations described? Or is something wrong in the way we use onRecordInsert? An example in the documentation would be very helpful btw.
Thanks and regards
Birgit
brTest4.servoy (3.53 KB)