Here's my contribution: If you have records with start and enddates and you want to switch between looking at all records or looking at the active records (active being: No enddate OR an enddate in the future), this would be the code for getting the active records:
controller.find();
enddate = '^' //Gets records where the enddate is null
controller.newRecord();
enddate = ">=" + utils.dateFormat(new Date(),'dd-MM-yyyy')+ '|dd-MM-yyyy'; //Where enddate >= than current date
controller.search();
For viewing all records you can use loadAllRecords.
One question on my part: newDate(), does it take the systemdate on the server where Servoy server is running, or the system date of the machine where the client is running? (sorry, can't test it myslef since both server and client are the same machine )
Paul