I’m using Version 3.0b3-build 364
Java version 1.5.0-b64 (Windows XP)
In another post it says:
in 3.0 we have made it much more customizable
databasemanager.setAutoSave(false)
will turn of autosave completely only the developer can call in a method
databasemanager.saveData()
Anything else will never save. (maybe a few very special circumstances it will but)
also the onRecordSave event can return false. This will stop the save to a database. (of everyting that is in the todo save list!)
I have an onRecordSave method:
if ( login_name == null || login_name == '' )
{
plugins.dialogs.showErrorDialog( "Error", "Empty or null Login Name", "OK");
return false;
}
return true;
Field login_name is defined with “allow nulls” unchecked.
When the onRecordSave method is called, if login_name is null or empty the error dialog is shown properly. The method the returns false and no attempt to save the record should be made.
Instead I get the following error.
Error saving 1 records
ASA Error -195: ‘login_name’ in table ‘catuser’ cannot be NULL.
I don’t want to turn AutoSave off. I do want to validate my data before I save. Surely Servoy offers sensible ways to do data validation.
If the onRecordSave method aborted the savewhen false is returned that would work well. And it is supposed to work that way I think.
Servoy engineers, could you please assist?
thanks,
Terry