So, in the past when we have wanted a form to load with an empty foundset, we have attached a method (clearMyfoundset) to the form’s onLoad event. Currently in Servoy 3.5.3 it does not appear that this method works any longer. What I seem to see is the following order of events
Form gets loaded
Database Performance Manger indicates that a query runs selecting X number of records for that table
Records get loaded
onLoad method fires, foundset gets cleared.
This of course is undesirable because the entire point of having an empty foundset is to cut down on load times.
We have currently started to use databaseManager.setCreateEmptyFormFoundsets() as a solution for the time being, which is mostly working fine. However, in the end this is also an undesirable solution as well, because it forces ALL forms to have this property, which we weren’t previously doing. This may be a bug, but we have noticed that sometimes we will load a record into a form before navigating to it, and then after navigating to the form, the record is gone.
My feature request is this, since it appears that Servoy performs a TOP query get the records to load into a foundset, could there be a form property, something like initialRecords, that would be the number of records Servoy should load into that form when the form is first loaded? That way, it could be the default of 200, 0 if you wanted no records, or even 1, if you wanted the foundset to not be empty, but also didn’t want to load hundreds of records.
I have also an unwanted situation when using databaseManager.setCreateEmptyFormFoundsets()
I also wanted to use the setCreateEmptyFormFoundsets because to many records are loaded.
I have a main form with a dynamic build tabform.
onShow of my main form, I create the tabform (in the example there are fixed names, but in real all names are variables, because it is in my framework)
When the initial load was ON, then the correct records were shown. But since I put the initial load OFF, the relation forms[‘chauffeur_tab’][‘chauffeur_to_percentenboek’] doesn’t have any records
Since there are no parent records, there are no child records to show neither.
I expect that the correct records on the childform are loaded. But that doesn’t happen.
So this seems a bug to me. When you define a relation for a tab, it should not matter if at the moment of creation there are records or not.
It happens both in 3.5.7 and 4.0.1
jcompagner:
i guess it is null or undefined right?
Yes indeed
But this is a serious problem. A relation is defined on design time, so it should not depend on if there are records in the foundset or not.
I see lot of records selected because of the default initial load of forms (max 200 records on each form)
And there is one way to avoid that and that is the databaseManager.setCreateEmptyFormFoundsets()
So both parent form and related form are initially empty.
But when I select a record on my parent form, then the related form must get a correct contents.
I think that the problem is that the relation parameter in the addTab() method is not correct.
In script we must use the syntax like in the example: