applyFilter( ) example
The following two event handlers demonstrate the basic filter-by-form functionality. First, before switching to Filter mode, get the bookmark for the current row:
function beginFilterButton_onClick( )
form.bookmark = form.rowset.bookmark( )
form.rowset.beginFilter( )
// Good place to visually indicate form is now Filter mode
Then when the user attempts to apply the filter criteria, you can try to go back to the row they were on:
function applyFilterButton_onClick( )
form.rowset.notifyControls := false // Suppress display of all this navigation
if not form.rowset.applyFilter( )
form.rowset.clearFilter( ) // No matches, get rid of filter
try
form.rowset.goto( form.bookmark )
catch ( Exception e ) // Couldn't go to saved row (maybe deleted)
form.rowset.first( ) // Go to first row in rowset instead
endtry
msgbox( "No matches found", "Filter", 48 )
endif
// Undo any visual indications of Filter mode here
form.rowset.notifyControls := true
form.rowset.refreshControls( ) // Refresh controls on form