
Have you ever noticed that when you explicitly call DataSourceName_ds.executeQuery() it reinstantiates the queryRun of the form and thus removes all the query filters (not ranges!).

This article explains ho to preserve form query filter throught Extension after explicit ExecuteQuery call on a data source : https://community.dynamics.com/365/financeandoperations/b/elandaxdynamicsaxupgradesanddevelopment/posts/preserve-form-query-filters-after-explicit-executequery-call-on-a-data-source-helper-class-included