onRecordSave event can return false?

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

is that method called?
Because it is only called on the visible form. So if you have a output statement at the moment you return false and that is printed then yes it should stop save.

If that is not the case please make a case for this in your support system.

is that method called?

The onRecordSave? Yes it is called and there is a visible form.

So if you have a output statement at the moment you return false and that is printed then yes it should stop save

I guess you mean does my method return false?

Its code is shown in the original message, and, as you can see, it returns false. And that does not stop the save.

If that is not the case please make a case for this in your support system

Well its not the case. It does not work.

This forum is called issues and bugs, so I mentioned it here. I also demonstrated it directly to Bob Cusik who said he would communicate to Servoy about it.

What is “your support system”? Is there some other place where bug reports should be submitted?

thanks,

Terry

tkilshaw:
What is “your support system”? Is there some other place where bug reports should be submitted?

That would be http://crm.servoy.com/servoy-webclient/ … oy_support
Use the same login/password as at http://developer.servoy.com