Foundset relation including an or statement.

Hi,

I have a form placed in a tab on which is set a relation. I need to change the relation to accept more data. In sql the new select would look like this:

	var sql = "select flight_plan_id from flight_plans \
						where deleted != 1 \
						and owner_id = " + globals.commonsOwnerId + " \
						and (contact_id = " + globals.commonsContactId + " or is_template_admin = 1)";
	foundset.loadRecords(sql);

I removed the relation and I’m calling this on the onLoad method of the form but all data is loaded, instead of only the records matching the sql.

And I also need the foundset to take into account these conditions when a seach is done, to mach only records in the initial foundset, or when loading all data to load only the ones in the initial sql.
Or for instance when deleted is set to 1 on a record. In this case the record should disappear.

I would like the same functionality as if the foundset would be based on a relation.

Is that possible? How?

I’m using servoy 5.2

Thanks!