The trouble is that with databaseManager.getFoundSet() you refer to a single table, so a datasource is appropriate.
But databaseManager.getDataSetByQuery() does not need a table, just the name of the server connection to use, so a datasource is too specific.
I think that is what he is asking. It’s just that we can’t get the servername that quickly anymore since controller.getServername() is deprecated.
My guess is that he wants it back
I would like to either have controller.getServerName() back or have a DataSource javascript object that allows me to do controller.getDataSource().getServerName(). The current call is really ugly.
Hi, I’m new here and really only exploring Servoy. I’ve come across this thread because I’m trying to use getDataSetByQuery()… and also found the code to get the ServerName a bit long-winded. So I did this:
function _getServerName()
{
return databaseManager.getDataSourceServerName(currentcontroller.getDataSource());
}
This function is only in the scope of your .js file. You could make it a global method so you can call it from anywhere.
Using the currentcontroller will give you the controller of the top most form. So if you call this function from a form in a tabpanel then you get the parent controller and not the controller of the form you called it from.
So to make such a function work you need to pass the form name or reference.
Anyway, such a method would be a workaround. Preferably I (and I think many others) would like to see this supported in the core functionality of Servoy.
Did anyone filed a feature request yet in the support system ?