It creates a copy of the related foundset, the foundset query is the same but it is no longer a related foundset.
Rob
That does not work - the moment you add the filter to the un-related foundset and call foundset.loadAllRecords() to apply the filter, the original filter from the relation is removed and only the explicitly set filter is applied.
You cannot add a tablefilter on a related foundset but you can use find/search on the related foundset where the relation will stay intact.
The nice thing is that you can find/search on the main foundset like this:
// Find customers with one or more orders containing one or more products supplied by a vendor in USA
if(foundset.find()){
customers_to_orders.orders_to_order_details.order_details_to_products.products_to_suppliers.country = 'USA';
foundset.search();
}
or through the related foundset like this:
// Find orders of THE SELECTED CUSTOMER that were shipped to Argentina
if(customers_to_orders.find()){
customers_to_orders.shipcountry = 'Argentina';
customers_to_orders.search();
}