Solved

Dynamic user filter used on opened tabs for the same subject

  • 28 January 2020
  • 3 replies
  • 100 views

Userlevel 3
Badge +11

We have the following requirement:

We would be able to let the user set a use filter for f.e. an ordernumber.

The user can open the orders tab/document and set the filter.

The filter data is stored in an employee_filter record in the application

The next step is to let the user open a new  tab/document - also orders - and the user set the filter to another order_number so he’s able to work on 2 different orders in one moment. 

So the 2nd should not affect the first opened tab. 

The problem is when setting the filter for the 2nd opened tab, de data on the 1st opened tab is changed conform the new filter when pressing F5 (refresh) 

We store the filter data in the application database per user.. A pre filter on the orders subject takes care of selecting the data based on the user filter as set in the application.

At this moment we have 1 employee_filter record with user filter data. We could create more but the problem is that we are not able to assign a specific filter record to a specific opened document/tab. 

See below screenshots. In the first we have more tabs named ‘opdrachtstructuur’

We would be able to keep tab 1 on order 1009563 abd we would be able te keep tab 2 in order 1008423, and we would be able to change the employee_filter record for those tabs indepent from each other and without using the GUI filter because we want to open the tab opdrachtstructuur prefiltered based on user data otherwise the application is opening al orders and orderlines in 1 tree structuure and the tree structure is not suitable for these amounts of data. 

Does anyone recognize this situation and has somebody a solution or work around  for this problem.

 

icon

Best answer by Frank Wijnhout 31 January 2020, 10:24

View original

3 replies

Hey Edwin, I understand you solution, but I don't quite understand what problem you are trying to solve.

I see that you have the same screen open twice with different filters. Why do you want to use a prefilter for this and why can't you just simply filter on each screen?

If you really need to store one or more prefilters per user, I would rather use the User Preference method for this.

Userlevel 3
Badge +11

Frank, thank you for your reply. 

we open this ‘opdrachtstructuur’ from the planning part of the application with a process flow which ends in the screens shown where the tree structure is exactly opened on the right spot, which is 3 levels deep. 

Perhaps we are on the wrong track and that’s exacly why I asked the question.

I try to explain my requirement a little bit more:

Basically the user should be able to open more ‘opdrachtstructuur’ screens where the filter of each screen can be different. 

The user should be able to open a new opdrachtstructuur from other parts of the application and the tree structuur should be opened on the exact level where it’s called from. The structure levels are:  order, subproject, day, order line. (We now open this structure with a process flow) 

The structure should show only the requested data which basically is: All orders of one client (With all sublevels closed but available) or all sublevels for one order. We have a task to set the required filter data. If an order is entered the ‘relatie’ field is disabled and vice versa. The data fields are automatically filled to restrict the amount of data. (The tree structure is not capable in handling a couple of thousand records) 

our solution till now is that this task saves user filter data in an employee_filter record, but that causes the problem that each opened ‘opdrachtstructuur’ is using that exact same filter. 

No-one of the thinkwise guys worked here as pointed me on the set-filter option in the process flow. So with your question and suggestion you triggered me. We can change this task above to a process flow which opens the tree structure and sets the filter for the structure. We should however open the tree structure with an impossible filter other wise it’s opened first with all data and than the application will crash. I will discuss it with Alex, who’s working for us at this moment. 

Hi Edwin,

At Thinkwise we have an idea for an extra data source. Now we use tables and view, but we also want to start using table valued functions. With the functions we can use input parameters which serve as a filter. This would restrict the amount of data a lot and also makes filtering a tree a lot easier.

For now this is not possible, but maybe you can use this idea to make a view for your tree using the following construction:

                                   
In this query the tree data is built up by using function get_order_tree. The code in this function is simular to what you have now, but filtered by sales_order_id. When you filter in your screen, SQL Server will first select 1 record from sales_order and after this start the function.

You might need a second query and screen for the situation you want to filter on relation. The query would look like this:

 

I hope this helps you finding your solution.

 

Reply