We are using the getsize method to display the count of records in a related tab panel. It seems in any situation of 40 or more records getsize always returns 40. In situations of less than 40 records it returns the right amount. Is there a threshold of 40 records for a tab panel? If so, it there any way to raise/change it?
40 is the default fetch size for a related foundset. Unrelated foundset sizes are 200, related foundset size is 40. That means that only the first 200/40 records are actually transferred. If you need to know the exact size of a related foundset, you have to use for example databaseManager.getFoundsetCount().
I notice that Servoy does this quite a bit. They only allow a select number of records to post through to the UI. This post is a great example. The problem being that if you don’t know this information, a person can spend days racking their brains wondering what is the problem. Like I just did!
Servoy does select all the data but fetches only a part of the result. But a user will never notice, because Servoy is smart enough to load the next fetch size into the table or whatever you are looking at without requiring a click on a next button. But, of course, there is a downside to this “lazy loading” of data: you don’t know how many rows your query returned. You can easily figure that out, but that involves another job to do for the database. From a performance point of view I would say the current behavior is right. So in short: it’s not a problem, but it’s something one needs to be aware of when counting rows… At some points, for example, I ask foundset.getSize() and if it results in 40, I put “40+” on the tab. On most tabs, you see something like “8”. This respects performance issues and gives the user a hint.