Hello,
The purpose of this post is to gather information of how to achieve the following requirement.
Assuming we have a module where lists all the jobs of a business, the user will have the ability to filter the jobs to be displayed through a criteria (or query, as you prefer). The filter is a feature that can be edited and works to enhance the navigation of the records. Let’s say there are so many jobs that the user wishes to navigate through only those jobs for the past five days, so he sets a filter where it shows only those jobs. That said, we also have to assume that whenever he does a search, he could choose to do either within the filter or against all database.
My question is what best Servoy can offer to solve this problem. We’ve considered to use addTableFilterParam and addFoundSetFilterParam, as well as doing the control of the filtered records by someway manipulating the foundset ourselves.
We’re not sure about addTableFilterParam because it’s applied over a table (we are already using it to filter data by organization), and we want to be able to search all records even if the filter is on. Moreover, addFoundSetFilterParam doesn’t have the ability to be removed, making things more difficult for us.
Any help is appreciated. Thank you.
We’re struggling with the same case/challenge from within our Servoy-solution-framework !
Any thoughts are welcome…
Try to apply the filter by using a simple search and you will get a foundset that is a subset of the table’s records; after that if the user wants to search INSIDE that foundset you can do that like this:
//Start the database search and shows the results, returns number of rows, make sure you did 'find' first!
var recordCount = forms.myforml.controller.search(true,true);//to reduce the foundset
Have a look at the documentation for the controller.search() parameters.
ngervasi:
Try to apply the filter by using a simple search and you will get a foundset that is a subset of the table’s records;
What are the implications of doing this if I have auto-save set to false? Is it possible to use search in this case? If not, is there any know workaround for using search with auto-save false?
Thanks.
I want to filter a foundset further with a condition in the SQL-notation of the where clause like (simple) example :
(order_employee=“Jan” or order_employee=‘Piet’) and ordertype=3. We can create these kind of filters through our own SQL-filter-condition-builder.
So I guess I can’t use the Servoy find and search functionality.
Do you see possibilities besides parsing and adjusting the foundset-SQL-query ? We have some problems now doing that on a form-foundset on a related tabpanel…
Hey, buddy… What you achieve is exactly what we have thought about before, to build a SQL-filter-condition-builder and then use the SQL statement to filter the records in memory.
We still don’t know how to do this. I’m not concerned of how to develop the query builder, but how to use and manage these objects loaded by the query in memory.
Any suggestions are welcome.
Thanks.
Not quite clear what the issue is here. As Nicola suggested, you can use the options of the search command to either search within the curretn set of records, or in all records in the table.
Autosave true/false has nothing to do with this, except that you cannot put a foundset into findmode if it has unsaved edits. When autosave is on, Servoy will automatically do the save for you, if autosave is off, you have to do it yourself.
I’d build a query builder/editor and use a scripted find/search to find the records based on the criteria the user put in.
Paul
Things were not quite clear but you answered my question pretty well, I guess.
I can then, from a SQL query, do a scripted search using the find/search feature and choose to search over the foundset or database.
I’ll see what happens when I start implementing this. Thank you.