Displaying a foundset count on form

Questions, tips and tricks and techniques for scripting in Servoy

Displaying a foundset count on form

Postby rodneysieb » Wed Jul 21, 2010 9:20 am

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

Code: Select all
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.
Regards,
Rodney Siebenhausen

logic@work
Brisbane, Australia
rodneysieb
 
Posts: 260
Joined: Tue Feb 14, 2006 9:11 am
Location: Brisbane, Australia

Re: Displaying a foundset count on form

Postby jcompagner » Wed Jul 21, 2010 2:32 pm

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()
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: No registered users and 8 guests