4 Replies Latest reply on Aug 21, 2012 12:52 PM by erickaczmarczyk

    multiple find requests - custom dialog

    erickaczmarczyk

      Currently I have a custom dialog search set up which sets a variable through a 'dialogFind' field, then search's that in another field.

      Something like this:

       

      Show Custom Dialog [Database::dialogFind]

      Set Variable [$find; Value:Database::dialogFind]

      If [Get (LastMessageChoice) = 1]

      Perform Find [Restore]

      Go to Layout ["Layout" (Database)]

      End If

       

      I'm looking to set this same thing up, but give say the second message choice the option to add another find request.

       

      any thoughts?

       

      thanks.

        • 1. Re: multiple find requests - custom dialog

          Why not just use a new up window which your users can enter multiple find requests?

          • 2. Re: multiple find requests - custom dialog
            erickaczmarczyk

            It's part of a larger workflow to move physical objects to a new location.

            I'd rather not have to create a new layout for the user just to do the search.

            They click a button on the homepage, a dialog pops up, they enter multiple numbers, perform a find and brings them to another layout where they can view the items.

            Trying to simplify all the windows and layouts.

            • 3. Re: multiple find requests - custom dialog
              DrewTenenholz

              Eric (at least I guess that's your name) --

               

              I know of two ways of getting what you want.  The first is most closely aligned with what you described, the second is a bit different, but will get the same result.

               

              1) Change your 'Perform Find (Restore)' into a loop roughly along the lines of:

               

              Enter Find Mode

                 Loop

                   Set Field (field name ; GetValue ( Dialog data ; n )

                End Loop

              Perform Find

               

              You need to set up conditions to parse out what the user is typing in the dialog box.  You need to be somewhat strict (or account for) all possible ways that a user might decide to separate their request values (will they choose commas?  returns? semi-colons?, etc.)  Once you do this, then you can figure out how to exit the loop and actually perfom the find.

               

               

              2) Since FM12 now stores the user-entered data with every button they click, you can set up a loop to repeatedly bring up the dialog & store each request and let the user tell you when they are ready to perform the search.  Sort of like:

               

              Loop

                Show Custom Dialog ( 'your message', option1='Find Now!'; option2='Add Request'; option3='Abort')

                Set Variable ( $lastMessageChoice ; Get ( LsatMessageChoice) )

                Set Variable ($request[n] ; 'dialog entry')

                Exit Loop if $lastMessageChoice = 1

              End Loop

               

              Enter Find Mode

                Loop

                   Set Field

                End Loop

              Perfom Find

               

              Depending on your users and the number of requests generated, one method may stand out for you.

               

              For inexperienced users, I'd prefer the second, and I'd probably also include a dialog field for 'include' or 'exclude' which would give the user the full power that 'Omit' allows for in the built-in find mode.  But, if the number of items specified is always more than about five, I think the first method is better.

               

               

              By the way, before whatever version of FileMaker that allowed the Perform Find (Restore; $varaible) was available, we always had to use the Enter Find Mode(), Set Field(), Perform Find() sequence.  In some ways, I still prefer it because it makes debugging easier to read instead of guessing what is being 'restored'. 

               

              -- Drew Tenenholz

              • 4. Re: multiple find requests - custom dialog
                erickaczmarczyk

                thanks, this was very helpful.

                I played around a bit with this info, I ended up performing a search, then if they picked to add it resets the variable and extends the found set with each additional.