4 Replies Latest reply on Jul 11, 2013 10:20 AM by jfb.fparker@

    Filtered layout on open compatible with IWP

    jfb.fparker@

      Title

      Filtered layout on open compatible with IWP

      Post

           I am using FileMaker Pro 12 and have layout(s) that are pulling data from multiple (related) tables.  I would like to have each individual layout open filtered, and then allow the user to search the found set utilizing value lists for specific fields.  What is the best way to perform this? 

        • 1. Re: Filtered layout on open compatible with IWP
          philmodjunk

               Use navigation buttons on your layout that perform scripts that take the user to the desired layout. (How we did this before script triggers--which don't work in IWP). The script can perform a find to filter the records and this find need only be performed when moving to a layout that is based on a different table occurrence in Layout Setup...

               A scripted find could then be set up that used constrain Found set instead of Perform FInd for searching that found set, but if you set up record level access control any find performed by the user will automatically filter the records found to show only those for which they are permitted access.

               See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a description of how to set this up.

               and a thread on scripted finds: Scripted Find Examples

          • 2. Re: Filtered layout on open compatible with IWP
            jfb.fparker@

            This looks like it will do exactly what I want, but I am having difficulties on the script:

                 -----------------------

            Go To Layout [Select a layout based on table being searched]

            Enter Find Mode [] ---> clear the pause check box
            Set Field [YourTable::YourField ; Globals::gField]
            Set Error Capture [on] ----> Keeps error dialog from interrupting script when no records are found
            Perform Find []
            If [Not Get ( FoundCount ) // no records were found ]
                Show Custom Dialog ["No records were found by this search."]
            End IF

            --------------

                 My table has a field named "category" and I want to filter the layout for a specific value from that field.  I have also inserted a global field into the table, but am not sure how the two relate in this (Set Field) step.

                  

            • 3. Re: Filtered layout on open compatible with IWP
              philmodjunk

                   You need the global field only if the user will enter different search criteria for that script to use in performing a find. If the category is always to receive the same criterion in every find, just specify that value directly in the set field step.

                   Set Field [YourTable::Category ; "Apple" ]

                   Will specify a search criterion of "apple" each time the script runs.

                   But if you set up record level access control so that the user is allowed to access only records with a specific value in category, this additional scripting is not necessary. Any find performed by the user--either manually or via such a script, will automatically omit the "no access" records from the found set.

              • 4. Re: Filtered layout on open compatible with IWP
                jfb.fparker@

                     Everything is working great.  I did not go with the global field at this time and utilized the record level access.  Works fine with IWP and gives me what I need at this time!

                     The knowledge base and forum are great resources, and thanks for helping to make it so.