HOW TO: return to previous foundset if searchResult =0

var dupFoundset = controller.duplicateFoundSet(); //copiesyour currentFoundset into a variable
controller.find();
//do search
if(!controller.search() ) // performs the search AND checks if result is empty
{
plugins.dialogs.showDialog('Alert','No searchResults','OK')
controller.loadRecords(dupFoundset)//restores your prev set.
}

thanks maarten...

Can I use the var dupFoundset = controller.duplicateFoundSet(); to save a found set by creating a separate table and storing the variable there for each found set? Also, is there a limit to the number of records in the found set that can be saved, e.g., can I save 100,000 records?

FYI - I'm coming from FM in which we copy all records and store the results in a field in a separate table (of course observing the 62K limit)

Thanks!