I assume you expect these lines of code to directly filter the table and load the records that match the filter?
This isn’t the case, this filter is added to your foundset’s rules.
So for example if you do a find on this ‘template’ table on let’s say the field ‘name’.
Without a filterrule, your find could return records where the field ‘is_template’ != 1.
With the filterrule applied Servoy will add the SQL that matches the filter to the background SQL that’s generated from the find example above.
I hope this shed some light on the filterfunction.
To be a bit more complete: you can easily add ‘controller.loadAllRecords()’ to your onLoad method.
This will loadAllRecords matching the filter you’ve set.