7 Replies Latest reply on Jun 17, 2011 9:34 AM by Ashtangakasha

    Display Found Set alongside search fields in Form Mode?

    Ashtangakasha

      Title

      Display Found Set alongside search fields in Form Mode?

      Post

      I'm designing a simple email list db with a Form View "list builder." The view context is a People list with contact info fields. The goal is to perform a search of the People list and export the found set as a CSV or TSV file for uploading to an email service.

      On the left side of a form I want to display a set of fields to use for searching. To provide the user with a view of the resulting subset of People, I want to provide, on the right side of the form, a scrollable list of the found set.

      I had thought this might work with a portal, but I haven't found a way to reference the found set in a portal.

      Any suggestions would be much appreciated. I'm a complete newbie with FMP11Adv, but I'm familiar with db concepts.

      Allen

        • 1. Re: Display Found Set alongside search fields in Form Mode?
          philmodjunk

          You cannot put found sets in a portal. If you split your screen the other way, you may be able to use global fields in the header with the found set listed below instead of splitting your screen the other direction.

          Given a few issues that can arise with editing global fields in the header, you may find it best to use a different layout and/or a pop up window for entering search criteria and then use the fields in the header to display the current criteria.

          If you are unfamiliar with how to use global fields to search your database let me know.

          PS. you may also be able to use a filtered portal to get the display that you want, but if you do, you'll need to add a script that replicates the filter expression's logic to perform a find to pull up the records in a found set when it comes time to export the data.

          • 2. Re: Display Found Set alongside search fields in Form Mode?
            aammondd

            You could add a field to your peoplelist to indicate found set.

            However you would have to clear it out of the foundset before the find loop through the found set and set the field to say X

            then have a global field set to X and establish the relationship for the portal that way.

            With lots of records it can be a bit lengthy.

            You can swap between the foundset and the rest for setting the field by showing omitted only. To do your field setting loop. You could also do a find where foundset = X and loop  that way then perfom the main find then set the field (probably the faster of the two)

             

            • 3. Re: Display Found Set alongside search fields in Form Mode?
              Ashtangakasha

              Thanks for the input.

              Phil, when you suggest "use a different layout" -- are you implying that there is a layout where the found set CAN be displayed WITH the search fields?

              I guess the most promising approach (from my GUI's point of view) might be to offer the user an initialized List View, with a button for a popup to fill in for the search. Or, if I understood your comment, set up the search fields in a big header. That would work fine, actually. The only trouble is that I'm doing everything inside a TAB control, so I guess I'd have to jump to a layout that isn't part of the tab setup.

              But your PS about a filtered portal also sounds interesting. However, I haven't started scripting yet (but I'm a programmer, so it shouldn't be a problem). It sounds like I might get the scrolling found set into a portal after all, but would then have to do a little scripting to create the data for export?

              Sorry for not getting this on the first try, but -- there is a way to display search criteria AND found set in the same layout, without using the Table View?

              I'm still a little disoriented by the View paradigm. It makes a lot of sense while using FM interactively, but when trying to build a self-contained kiosk environment it's a bit less intuitive than having a single set of controls, methods, properties, etc. I'll get the hang of it...

              • 4. Re: Display Found Set alongside search fields in Form Mode?
                philmodjunk

                Phil, when you suggest "use a different layout" -- are you implying that there is a layout where the found set CAN be displayed WITH the search fields?

                Any number of layouts can be used like this if you store your search criteria in global fields. The header is probably the best place to display them. The layout itself can be a list, table or form view layout, though a list view is probably best for this. I suggested "use a different layout" because this lays out the search criteria and found set in a different arrangement than you requested in your first post.

                One thing that I have been assuming is that you know how to create a script that takes the criteria the user enters into global fields and then performs a find to find them. If this is not the case, either I or aammondd can describe such a script pretty easily.

                It's certainly possible to use a filtered portal here--especially if you are using FileMaker 11 where you can set up filter expressions in Filter Setup, but it's not as straight forward as simply using a list or table view layout to display your found set with the search criteria listed in the header. The records listed in the portal will not be your current found set that would be exported so once you pulled up the records you wanted in the portal, you'd still have to perform a find before you export and you'd need to do so in a way that pulls up exactly the same records in your found set. This method is easiest to use if you are only specifying simple criteria in one or two fields. The more complex your criteria, the trickier this approach becomes.

                • 5. Re: Display Found Set alongside search fields in Form Mode?
                  Ashtangakasha

                  That's great -- I'd prefer to keep the whole app inside a tab control, but in any case it looks like I need to learn about using global fields for searching. I'd love to take you up on your offer to get me started on the required script (presumably invoked with a button on the form). The view being searched is based on the People table, with a one-to-many with Donations and a many-to-many with Address. And yes, I'm using the FM Pro Adv 11.3 . The app is destined to become a kiosk, if possible. Only a few thousand People records, and ultimately only 4-5 users. (I'm starting small.)

                  I've only just started perusing the forums, and I see your generous assistance everywhere (and aammondd's). This speaks highly for FM and the forum as well. Many thanks!

                  Edit: I forgot to mention that I want the user to be able to review the found set and remove records that he doesn't want to be exported. Without, of course, changing anything in the original tables.

                  • 6. Re: Display Found Set alongside search fields in Form Mode?
                    philmodjunk

                    The more you describe here, the more a list view of your found records makes sense. Omit record can drop records out of the found set so that they are not exported and this would takes some doing to drop them out of your portal then script a method to pull up the remaing portal records in a found set.

                    Here's a simple outline of a scripted find that uses criteria entered into a single global field. You can expand on this script to include criteria from more than one global field.

                    #This script finds all records where the date in TxDate is greater than or equal to the date selected in gTxDate
                    Enter Find Mode [] //clear the pause check box
                    Set Field [Yourtable::TxDate ; "≥ " & YourTable::gTxDate
                    Set Error Capture [on] //disables error dialog telling you no records were found
                    Perform Find []
                    If [get (FoundCount ) = 0 ]
                       Show Custom Dialog ["No records were found with transaction dates ≥ " & YourTable::gTxDate]
                    End If

                    • 7. Re: Display Found Set alongside search fields in Form Mode?
                      Ashtangakasha

                      Thanks! I'll implement your approach and see how it goes. Your help is very much appreciated.

                      Allen