modify or select query filter at runtime

modify or select query filter at runtime

  

Is there a way to select from your defined query filters at runtime?

I want to define a filter that the user can choose to include or not include. I want the user to view a list of tasks that could have status closed or open. Usually a user will only want to see open tasks (status = open). Sometimes a user will want to see closed tasks also.

Can I define a filter that is "status = open" or even "status <> closed" (in case I add more values), and then at run time let the user click a button (Show Closed | Hide Closed) to choose to include this filter or not include it?

Thanks.

Hi Bill, 


Wouldn't it suffice to define your filter as:

ShowClosed = True or Status <> closed? 


As new to OutSystems I might be missing something simple here. But, with what I know, no. I want the user to be able to toggle at run time whether or not they see the Closed items. That would mean a button that would say either 'Show Closed' or 'Hide Closed' and would set whether the aggregate query should include a 'status <> Closed' filter or not.


Is there a way to elect at runtime whether or not to include filters you have defined in the aggregate?

Bill Adams wrote:

As new to OutSystems I might be missing something simple here. But, with what I know, no. I want the user to be able to toggle at run time whether or not they see the Closed items. That would mean a button that would say either 'Show Closed' or 'Hide Closed' and would set whether the aggregate query should include a 'status <> Closed' filter or not.


Is there a way to elect at runtime whether or not to include filters you have defined in the aggregate?

Bill,

You can use the filter that Lennart said and use a local variable of type Boolean named ShowClosed.
Then you can have a button with "Show/Hide Closed" and on his action assign the local variable with his opposite value. After you refresh your agregate and the table/form.


Abílio Matos