Are you on 4c4 or LN? In 4c4 you have query.extension - I usually have a filter program that calls the session that will be filtered. In LN look at query.extend - in LN you can rebuild the queries.
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.
systems provided free by Baan Board
Play the Google game and help Baanboard get better rankings. Do your part. Click here
to find how.