1 2 3 Previous Next 32 Replies Latest reply on Dec 22, 2015 10:04 AM by siplus

    Using Radio Button or Check boxes to do finds

    lbellino

      Hello.

       

      I was wondering if it's possible to do multiple finds/searches using either radio buttons (like image attached) or check boxes? Currently, I'm using the table where the finds would be coming from, but not sure if that's correct, since right now, it's just showing the data from a current record from that table and if you pick on a button, it will change the data for that record, which we don't want to do.

       

      The goal of this layout is where anyone can go in and do their own search for a particular store or stores from the fields shown based on what they select and to export this data for their use. For example: I want to search for all stores that have the following data (based on image attached):

       

      2F-BL & 2F-BR

      FULL & SMALL

      2F

      BL & BR

       

      Please let me know if this is possible or if there's a better way to achieve what I'm trying to do. Thanks for your help.

        • 1. Re: Using Radio Button or Check boxes to do finds
          dtcgnet

          Create a Globals table if you don't already have one. Create a global field for each item that you want to search on:

           

          g_StoreNumber

          g_Prototype

          g_StoreSize

          g_EntranceCode

          g_DockCode

           

          Apply the appropriate value list to each field. Make sure each field uses Global storage.

           

          You can do it all sorts of ways. You can fire an OnObjectModify trigger any time a user selects something in each field. Or you can give them a "Run" button which they have to click in order to do the search. It would be something like:

          Run

          1) Set variable to global field 1

          2) Set variable to global field 2

          etc.

          Enter Find Mode

          Set field 1 to variable 1

          Set field 2 to variable 2

          etc.

          Perform Find

           

          Right now, you're using fields that actually exist and are filled with data. That's why the buttons are changing the data. The use of the globals and/or variables will fix that problem for you.

          • 2. Re: Using Radio Button or Check boxes to do finds
            siplus

            Very basic FM operation:


            You need to first go into find mode, then set your radio buttons, then perform the find.

            Then go to a list layout to display the results.

            • 3. Re: Using Radio Button or Check boxes to do finds
              lbellino

              So based on both responses to my question, I can still use the table that

              I'm using that houses the data for either of these finds without anyone

              editing the data as long as I set up the securities on this layout, correct?

               

              Plus for either of these options, a couple of questions:

              1. This dashboard is being created for people that has little to no

              Filemaker experience, so either option will suffice for this?

              2. Do both these options allow for multiple finds within each data field?

              So if someone what to look up two different Protocodes, along with the

              other data, to list all the stores that are within their selection, it's

              easily done for them?

               

              I'm trying to create a layout that is simple and easy to use, which is why

              I was trying to use radio buttons for someone to click on the data they

              were searching for.

               

              Please let me know if both these options will work based on my questions.

              Thanks.

               

              Thank you.

               

              Laurie Bellino|* S2 - Database*

              *Kohl's Innovation Center | W165 N5830 Ridgewood Dr. | Menomonee Falls, WI.

              53051*

              262.703.6675 (office) | laurie.bellino@kohls.com <http://kohls.com>

              • 4. Re: Using Radio Button or Check boxes to do finds
                siplus

                For people that have no experience, we need to build a really tamper-proof procedure.

                 

                If you want to select more than one option for a specific field we need to go the checkbox way (radio buttons are built to offer only one choice, although there's a way to circumvent that, but let's not digress).

                • 5. Re: Using Radio Button or Check boxes to do finds
                  siplus

                  So based on both responses to my question, I can still use the table that

                  I'm using that houses the data for either of these finds without anyone

                  editing the data as long as I set up the securities on this layout, correct?

                   

                  YES

                   

                  Plus for either of these options, a couple of questions:

                  1. This dashboard is being created for people that has little to no

                  Filemaker experience, so either option will suffice for this?

                   

                  YES

                   

                  2. Do both these options allow for multiple finds within each data field?

                   

                  YES

                   

                  So if someone what to look up two different Protocodes, along with the

                  other data, to list all the stores that are within their selection, it's

                  easily done for them?

                   

                  YES

                   

                  I'm trying to create a layout that is simple and easy to use, which is why

                  I was trying to use radio buttons for someone to click on the data they

                  were searching for.

                   

                  Begin by creating a privilege set that can't modify records + create a user with that set and make sure noobs login through that one, to start with. Always protect your data first, then think about making users happy

                  • 6. Re: Using Radio Button or Check boxes to do finds
                    lbellino

                    Not sure why I can't reply via the post itself, so I'm doing this through

                    my email.

                     

                    I created the script from your response, which I've attached an image.

                    Don't believe this is correct how I have it (could have interpreted your

                    comment incorrectly). So please let me know what I did wrong here.

                     

                    Also I attached additional images as follows:

                     

                    One is of the page that a person will do there search/find for records with

                    the data on this page they select. I can select some, but after running the

                    script with the "Run Report" button, I get a pop to "modify" the find,

                    which I've also attached this image.

                     

                    And the last image shows the record count of the table that I have

                    associated with this layout, which are the records where the data is coming

                    from when a person searches for it.

                     

                    The good thing is that when I click the checkboxes, it doesn't seem to be

                    changing the data in the records. But I did make all the field for this

                    layout Global as noted, along as making the storage Global.

                     

                    Any help on getting this work, would be much appreciated. Otherwise, if I

                    go with the second option with just having the persons doing a regular

                    find, are they still able to do multiple selections in any of the fields on

                    the page without having to create multiple requests?

                     

                    Thank you.

                     

                    Laurie Bellino|* S2 - Database*

                    *Kohl's Innovation Center | W165 N5830 Ridgewood Dr. | Menomonee Falls, WI.

                    53051*

                    262.703.6675 (office) | laurie.bellino@kohls.com <http://kohls.com>

                    • 7. Re: Using Radio Button or Check boxes to do finds
                      dtcgnet

                      You probably weren't logged into the forum, which is why it wouldn't allow you to reply to the posts there.

                       

                      As for where you are...

                       

                      The goal is this:

                      1) You have actual data, NOT global storage, in your table called STO_Store. Don't mess with anything in STO_Store. That is your ACTUAL DATA.

                      2) You'll have temporary data in a brand new GLOBALS table.

                      3) When a user clicks something in one of the global fields, it affects no real data, but it does give you something to work with.

                      4) After they click "Run Report", THEN your script grabs the values in the Globals, enters Find mode, and sets those values into your regular STO_Store fields. When the script fills in the data the user has entered, then it performs a find.

                       

                      So, you're close. Hopefully you're working in a backup, because it looks like you may have changed live data fields to Global storage, and if so...then any previously existing data is gone.

                      • 8. Re: Using Radio Button or Check boxes to do finds
                        lbellino

                        So should I change the table that is associated with this layout then so I can test the script as you noted? And do I have the script written correct?

                         

                        Right now, no data has changed.

                        • 9. Re: Using Radio Button or Check boxes to do finds
                          dtcgnet

                          The table that is associated with the table should be the one in which you want to find the records. So, if you're looking for Stores, then use the table STO_Store as the base for the layout.

                           

                          Globals don't need any relationships to any other tables when used this way, which is one of the benefits of using a separate globals table in this way.

                           

                           

                          Your script looks like a good start. In the Set Variable portion, make sure you reference the Global fields. In the Set FIELD portion, set the fields from your STO_Store table equal to the variables you set earlier. You could just set them to the global values without setting variables, but down the road, you'll need those variables in order to do some things such as separate out the values in each field.

                           

                          But you're very close. Get it working and go from there. When you are testing, check only one box in one field. That'll let you know if it's actually working.

                           

                          Your problem is going to be this: these values will result in an "AND" search. If you click Full for store size and 1993 for year remodeled, you'll find ONLY stores that are Full Size AND remodeled in 1993. OR searches open up a whole new can of worms when used in the way you want. For instances, if you check 1992 AND 1993, you need ONE search request to look for 1992, and ONE search request to search for 1993. By checking both, you will be creating a return-delimited list in that field. Example:

                          1992

                          1993

                           

                          FileMaker would look for records with BOTH of those values as one, and it won't find any.

                           

                          Get your find working with Radio Buttons, then go from there as you build.

                          • 10. Re: Using Radio Button or Check boxes to do finds
                            lbellino

                            Thanks so much for your help and for being patient with me for not getting this based on just comments alone. I did fix the script to where the SET FIELD line items are set to the actual fields of the date that match up with the variables I set. (see script image) Also provided an image of how I set up the variables, in case it's incorrect.Script.jpgvariable.jpg

                             

                            I did leave it as check boxes for now, since I want to test out the multiple finds, after I get this script to work and see the outcome to determine if it's what I'm looking for or not. Then I can always change back to a radio button.

                             

                            Based on how this is set up now with the script as I have it, I can click on any of the check boxes (multiple or not in each of the data field area), that I want to do a find of and when I click on the run report button now, I still get the same pop up that the find criteria is not valid, so when I click on modify find button, now I can't click on any check boxes (now that it's in the "find" command), which I'm assuming it's because these are global fields, correct? So I'm not sure what to change to get this to work, unless I just do the standard find and just make sure securities are set up. But I would prefer to get this to work to make it as easy as possible for people to use for their searches, since most will have very little training in Filemaker, and they are pretty much using this and filemaker for reports only to export/print.

                            • 11. Re: Using Radio Button or Check boxes to do finds
                              dtcgnet

                              You're getting close.

                               

                              In the Set Variables part of your script, you need to do something like:

                               

                              Set Variable $OpenYear ; Value: g_OpenYear >>>This is from your globals table

                               

                              And so on. That looks at what the user has entered in the globals.

                               

                               

                              Then down below in the Set Field portion:

                               

                              Set Field [STO_Store::OpenYear ; $OpenYear]

                               

                              And so on.

                               

                              You're storing what the user has entered into globals, then you're regurgitating that as data for your find.

                               

                              Give that a shot and I think it'll work.

                               

                              The reason you're getting an Invalid Find Criteria message because you're not actually setting any of the fields to anything, so your find criteria is completely blank right now.

                              • 12. Re: Using Radio Button or Check boxes to do finds
                                erolst

                                A suggestion to simplify your script: use a utility relationship that you set in the script:

                                 

                                Set Variable [ $id ; SourceTable::id ]

                                Go to Layout [ Target ( TargetTable ) ]

                                Set Field [ TargetTable::gTempID ; $id ]

                                Set Field [ TargetTable::someField1 ; SourceByUtilityGlobal::someField1 ]

                                Set Field [ TargetTable::someField2 ; SourceByUtilityGlobal::someField2 ]

                                # [ … etc. ]

                                 

                                Saves you all these Set Variable[] steps in the first half.

                                 

                                PS: Check the “Repetition” value for your Set Field[] steps; that doesn't look kosher …

                                • 13. Re: Using Radio Button or Check boxes to do finds
                                  dtcgnet

                                  Good catch on the "Repetition" value. Laurie, when you clicked into the Set Field, you used the Repetition area to indicate which came first and second and so on. Unfortunately, that'll cause you problems. Set them all back to 1 and make the other modifications.

                                  • 14. Re: Using Radio Button or Check boxes to do finds
                                    lbellino

                                    Some questions on erolst's response.

                                    • Am I creating a new table here for my "TargetTable" and that's where all my Global fields I created need to go in this table? Currently, my global fields are located in my "stores" table that has all the data in it.
                                    • From what you answer from my first question, if this is new table, am I created another global field that should read, "gTempID" or is this the field where are all the store ID's that I have set for that is in my Source Table?
                                    • When I do the "Set Variable" sounds like I'm just creating one of these instead of the 12 I have now, correct?
                                    • If so, for the SourceTable::id (I'm assuming this is the table where I have the data stored) which one do I pick here, since it will want me to choose one here and not the 12 that I have on my layout?

                                    Just want to clarify before I add things that may not need to be added, if I'm not understanding your comments correctly. Hope my questions make sense and thanks for your help and being patient with me.

                                    1 2 3 Previous Next