Displaying a foundset count on form

Hi

Am finally getting around to upgrading an old (but large) solution to version 5.1x. I have successfully imported and cleared all errors and warnings (problems) in my solution.

I was using the following global method to write a foundset count to a global and then display this global on a form

var x = " (" + databaseManager.getFoundSetCount(forms[currentcontroller.getName()].foundset) + " records in foundset)";
globals.rec_display = x

I would then call this method “on show” of form or after a find to display the current foundset of the current form.

This worked fine in Servoy 2.27 but now i get “0 records in foundset” on show of the form. If i “load all records” however it works correctly

Has this somehow changed in 5.1x?

Also I note that controller.saveData (); has been deleted. Is this still supported or should i search/replace with databaseManager.saveData () everywhere as soon as possible?

Any help would be appreciated.

that should still work fine
what happens if you right before you assign x you do:
application.output(forms[currentcontroller.getName()].foundset.getSize());

So what is the ‘current’ size of the foundset when you ask for the total size?

controller.saveData() still works but the preferred way is now to use databaseManager.saveData()