You must apply the filter before the super()
in executeQuery()
.
But I think your problem is you add the filter every time the executeQuery()
is run, resulting in an OR in the SQL expression generated.
This is the way to do it:
QueryBuildRange qr = SysQuery::findOrCreateRange(this.query.dataSourceNo(1), fieldnum(MyTable,MyField));
qr.value(queryValue('MyRangeValue'));
qr.status(RangeStatus::Locked); // Or ::Hidden