How can a Find be cancelled in a method without loosing the original found sub-set of records?
Dean Westover
Choices Software, Inc.
How can a Find be cancelled in a method without loosing the original found sub-set of records?
Dean Westover
Choices Software, Inc.
Hi Dean,
I think the only way is to store the foundset in a variable before entering the find mode.
When cancelled you load the saved foundset.
Of course you can save this foundset in several ways. The whole foundset object, or the SQL and arguments.
Depending on your needs you use one or the other.
I believe when you load a foundset object (controller.loadRecords(foundset)) you can end up with a ‘seperate foundset’. In other words no longer in sync with other forms using the same table. Not so when loading SQL and arguments.
Hope this helps.
ROCLASI:
…I think the only way is to store the foundset in a variable before entering the find mode.
When cancelled you load the saved foundset…
Yes, that is exactly what I would like to do. However, it is not working for me. An example of the syntax that should work would be greatly appreciated.
Dean Westover
Choices Software, Inc.
var vSet = foundset;
``` should do the trick Dean...
Still testing. If I clear the records in the same method, then how can I bring back the original found sub-set of records. I seem to keep getting all the records instead of the original found sub-set of records.
Dean
Servoy Developer
Version 3.5.7-build 520
Java version 1.5.0_05-b05 (Windows XP)
Hi Dean,
Did you use the following syntax ?
var fs = foundset.duplicateFoundset();
and to reload it:
controller.loadRecords(fs);
Another way would be to store the SQL + params
var sQuery = databaseManager.getSQL(foundset);
var aParam = databaseManager.getSQLParameters(foundset);
And to restore them:
controller.loadRecords(sQuery, aParam);
Hope this helps.
I like both approaches. Thank you all very much!
Dean
How do you know when you are canceling a Find?
Are you somehow getting arguments back that distinguish it from an execution?