Skip to main content
Solved

Is it possible to define a filter value like a default value


Forum|alt.badge.img+7

I'd like to define a default filter value for a field. This value depends on a selected row in a table.

Is therefor aa possibility in the software factory? I'm working with the installation 2021.3

Thanks in advance

Best answer by Erwin Ekkel

This how I did it (there’s probably more ways to achieve this): 

I created a table with two columns username, filter value. On executing the task the current row value is written to the table with the current user_id. If you want to use this concept on multiple tables then you should addd tablename to the filter table. The basic flow looks like this: 
 

In the Task I set the value to the filter table(I did an update since the value already exists but for your code a delete and insert would work):
 



Then in the preftiler I use query with the filtervalue from the filtertable, for the current user. 

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

5 replies

Forum|alt.badge.img+17
  • Moderator
  • 766 replies
  • December 1, 2021

Do you mean setting a default value on the filter based on the current row? 
 


That’s not possible to do. Can you explain why you want this functionality? Would it not be easier to create some prefilters? 


Forum|alt.badge.img+7
  • Author
  • Sidekick
  • 30 replies
  • December 2, 2021

I want to filter on articles that have been sawn. The thickness will depend on the thickness of the raw material. Thicknesses can only be reduced. Then I only want to see articles with a thickness less than or equal to the thickness of the raw material. I can't do that with prefilters as far as I know.


Forum|alt.badge.img+17
  • Moderator
  • 766 replies
  • December 2, 2021

Is this what you mean? I created a task that activates a filter based on the JJJ column and filters all rows equal to or smaller than JJJ’s value. 

 

 


Forum|alt.badge.img+7
  • Author
  • Sidekick
  • 30 replies
  • December 2, 2021

This could probably do the job. The filter is on a lookup. Can you send me the code for the task in your example?


Forum|alt.badge.img+17
  • Moderator
  • 766 replies
  • Answer
  • December 3, 2021

This how I did it (there’s probably more ways to achieve this): 

I created a table with two columns username, filter value. On executing the task the current row value is written to the table with the current user_id. If you want to use this concept on multiple tables then you should addd tablename to the filter table. The basic flow looks like this: 
 

In the Task I set the value to the filter table(I did an update since the value already exists but for your code a delete and insert would work):
 



Then in the preftiler I use query with the filtervalue from the filtertable, for the current user. 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings