3 Replies Latest reply on Apr 16, 2017 4:25 PM by philmodjunk

    Dynamic Reporting Checkbox Query

    oman

      I'd like to create a layout for my database that allows the user to make field selections in the top header and have the list of records below (in list view) dynamically update based on the selections. In other words, as a user selects different field values (a date range, product status, product type) the query would combine the selections and only show records that match all those criteria. And unselecting one would show all the records again without having to select Show All and make selections again. I'd like to use a mix of check boxes and drop down menus.

       

      This would be different than just entering Find Mode, setting all of the search options and then running the query. I want to basically stay in Browse mode and have the database adjust the query on the fly (showing and hiding records) based on what is selected at the top.

       

      Any best practice suggestions or examples would be appreciated.

       

      Thanks!

      Oman

        • 1. Re: Dynamic Reporting Checkbox Query
          philmodjunk

          Put a series of global fields in your header. Use either OnObjectModify (check boxes, radio buttons pop up menus) or OnObjectSave ( Edit Boxes, drop down lists ) to perform a script that:

           

          a) enters find mode without pausing

          b) sets up the needed find criteria from the data in the global fields

          c) performs the find

          d) processes the result as needed (Tells the user that no records were found, sorts the found records, etc.)

           

          The user never sees the system enter find mode, they just see a new found set of records appear every time that they modify the search criteria in the global fields.

           

          To see some example scripts that use data from global fields to perform finds, see this discussion:

           

          Scripted Find Examples

          • 2. Re: Dynamic Reporting Checkbox Query
            oman

            Great thanks Phil. Am I right that my script needs to set field for all of the Global Fields that the user could potentially set? So if I have 5 global fields, the script triggered after entering data in one of those fields needs to set field for all 5 of the global fields so that my query updates as each combination of data changes, correct? And therefore its the same script for all of the global fields in my header?

            • 3. Re: Dynamic Reporting Checkbox Query
              philmodjunk

              Yes a single script can be used as you describe, but your script might need to check for all fields empty and do a show all records. (I forget if clearing all search fields finds all records or not, so test and use Show All if that you find that it's needed. )