var fs = controller.duplicateFoundSet();
var count = databaseManager.getFoundSetCount(fs);
and this fails ( count = 0 ):
var ds = controller.getDataSource();
var serverName = databaseManager.getDataSourceServerName(ds);
var tableName = databaseManager.getDataSourceTableName(ds);
var fs = databaseManager.getFoundSet(serverName,tableName);
var count = databaseManager.getFoundSetCount(fs);
var ds = controller.getDataSource();
var serverName = databaseManager.getDataSourceServerName(ds);
var tableName = databaseManager.getDataSourceTableName(ds);
var fs = databaseManager.getFoundSet(serverName,tableName);
var count = databaseManager.getFoundSetCount(fs);
databaseManager.getFoundSet() function always returns an empty foundset. You need to first load some records in there using the loadRecords() function.
A foundset is an object that is linked to a table (and therefor a server connection as well). It may or may not hold any PK’s (and fetched/changed data) from that table.
Using the databaseManager.getFoundSet() gives you just that. An empty foundset. In fact it’s also a non-linked (as in separate) foundset.
Being a separate foundset it means it won’t have the same 9 records that your form has.
But to be able to give you a better answer to your question let me ask you what you want/need to do exactly?
I was just trying to update a deprecated statement, and got sidetracked playing with databaseManager
so:
var fs = controller.duplicateFoundSet(); becomes
var fs = foundset.duplicateFoundSet();
Another question: I can see why “foundset” is shown under each Form, but why not in Database Manager ?
and if Servoy’s “controller” and “foundset” objects are similar, why are “controller” and “foundset” represented differently in the Solution Explorer ?
since I don’t use Servoy everyday, I find it hard to find things …
greg
PS
and why not more meaningful names, perhaps databaseManager.getNewFoundSet(serverName,tableName) ?
controller and foundset are completely different things…
controller is a ui thing, controlling the forms ui stuff (like selecting an index, requesting focus and that stuff)
also a controller has the showFoundset() method so that it can show a foundset in the ui.
yes it has methods that are passed through to the foundset
The foundset object is the object that holds the data/records from the table.
But why are you trying to duplicate foundsets? What are you doing with the duplicates?
because in the first post you do:
var fs = controller.duplicateFoundSet();
var count = databaseManager.getFoundSetCount(fs);
why is that?
why not
var count = databaseManager.getFoundSetCount(foundset);