Hi,
I have a global method that is scheduled to run every x seconds, using the scheduler plugin.
In this global method, I insert records into a table, using the following code:
forms.xxx.controller.newRecord(true);
forms.xxx.field1 = new Date();
forms.xxx.controller.saveData();
If I’m on form xxx while the sceduler fires the method, there’s no problem, but when I’m on a different form (yyy) while the method is fired by the scheduler, the onRecordsave method of form yyy is fired by the follwing line form the global method:```
forms.xxx.controller.saveData();
When I define the global method as a form method on form xxx, I get exactly the same behavior.
Is this a bug or is this just not something that can work?
Paul
Servoy Developer
Version R2 2.2.4-build 336
Java version 1.5.0_06-b05 (Windows 2000)
As far as I know, saveData() is not bound to a form but saves all outstanding changes, not matter what form.
OK, but then I would think that it onRecordSave would be fired, also if I’m viewing form yyy, but that doesn’t happen.
Also, the onRecordSave method is not fired if I call a controller.saveData(); through a button on form XXX (added a test button to test this).
Stepping through the global method, while on form xxx, I see hte little “E” comming on in the statusbar on the bottom of the screen when the “forms.xxx.controller.newRecord(true);” line is executed.
Paul
Probably, like most form properties dealing with commands, onRecordSave is only fired if you manually hit the save button?
Que? It’s NOT fired when hitting a button, but it is fired when the scheduler fires the method.
I altered my onRecordSave method a bit now, to return immediatly if it’s fired in this situation, so the immediate problem is gone now, but it remains a strange situation, I think.
Paul