9 Replies Latest reply on Oct 11, 2012 9:34 AM by philmodjunk

    Returning multiple answers from a match field

    OllySedden

      Title

      Returning multiple answers from a match field

      Post

           Heya,

            

           I'm really new to FileMaker Pro Advanced (to any form of programming in fact!)

            

           Basically; i have two tables displaying various columns of information (the two tables have the same columns in each). Its comparing existing products with products we would like to replace them with; so the columns could be the power of the fitting, output, etc... 

           I want to select an existing fitting from a dropdown menu (which i've managed to do...). I then want to select the type of fitting to replace the product with another dropdown menu. I then need to be able to select one from all the options available that match the same 'type of fitting'. there are, say, 5 types of fitting, each type could contain several dozen to several hundred products; but i want the sheet to list all those products with the say type.

            

           So far i can only get it to return 1 possible product instead of giving me a choice between multiple products...

            

           can anyone help? any help would be much appreciated!

            

           Thanks!

        • 1. Re: Returning multiple answers from a match field
          philmodjunk

               I think you are describing a conditional value list--where you select a "category" in one value list formatted field and then the next field lists only values that are a member of the selected category. For example, you could select a "fitting type" in value list one and then the value list in the next field lists only fittings of that type. On the other hand, you could be describing a portal where the portal displays only fittings of a type selected in the value list.

               Here are some links on conditional value lists:

               Forum Tutorial: Custom Value List?

               Knowledgebase article: http://help.filemaker.com/app/answers/detail/a_id/5833/kw/conditional%20value%20list

               Demo File: https://www.dropbox.com/s/j6qf0z9fnem3uxd/ConditionalValueListDemo.fp7

               Hierarchical Conditional Value lists: Conditional Value List Question

               Feel free to post follow up questions here if those links aren't enough to get your value lists working correctly. Please also note that the relationships described in these links can also be used to place a portal on your layout that list the same records as those used in the conditional value list.

          • 2. Re: Returning multiple answers from a match field
            OllySedden

                 Thanks so much for your response! 

            "For example, you could select a "fitting type" in value list one and then the value list in the next field lists only fittings of that type"

                 Thats exactly what i want to be able to do; to be able to select a fitting from that second list; i'v enow managed to get a portal to return all the fields that have the same 'fitting type' but i cant select that fitting, it just lists it. 

                 Thanks again for your response! i'll have a look through the links you posted!

            • 3. Re: Returning multiple answers from a match field
              philmodjunk

                   By adding a button to your portal row, you can use a script performed by that button to select the item.

              • 4. Re: Returning multiple answers from a match field
                OllySedden

                     Thanks for your help! 

                      

                     I've managed to sort all my data by just filtering it down through the use of 2 of these drop-down-conditional-formatted-menus...

                      

                     But my output is a portal with a scroll bar so i can see multiple fittings to use as a replacement. How do i then make the fitting into a button that i press and it inserts it into a single field? i currently have 5 fittings in my portal, but just want to select one and put the result in a non-editable field for further use; how do i do that? 

                • 5. Re: Returning multiple answers from a match field
                  philmodjunk

                       Say your portal specifies "SelectedFittings" in Portal Setup | Show Related Records From.

                       Then this single script step will do what you need: (Substitute your table and field names for mine)

                       Set Field [YourTable::PartID ; SelecdFittings::PartID]

                       Enter Layout mode, select the fields in your portal row and use button setup... to turn them into a button that performs the above script.

                  • 6. Re: Returning multiple answers from a match field
                    OllySedden

                         Thanks for your quick reply! 

                          

                         my portal doesnt return a table though, it returns a list that the user can scroll through with a scroll bar.

                          

                         I currently have two drop down menus; same as in your demo. The first filters the data by the 'type of fitting' and the second filters by 'family name'. I then have a portal which returns all the fittings that fall under that family name under that type of fitting. i then need the user to be able to click on their chosen fitting and it then be selected in a seperate field. When i click on 'button setup' in the portal, i can then see the "Set Field [.....]" function, but i can only seem to specify 1 field from 1 table... have i done this wrong? sorry to be a pain, i really appreciate your help!

                          

                          

                    • 7. Re: Returning multiple answers from a match field
                      philmodjunk

                           Note: I prefer to create an actual script for each button and use the Perform script button option instead of just a lone script step, but either way, the following info applies:

                           When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                      • 8. Re: Returning multiple answers from a match field
                        OllySedden

                             Thanks for all your help! i'v emanaged to get a reasonable amount done in the last week! 

                              

                             i was just wondering; how easy is it to enable/ disable a set of fields at the push of a button? 

                              

                             For example, if i only want to enter information in the first half of the form, but want the second half to remain 'greyed out' until i press a button, how would one go about doing that? 

                              

                             Many thanks for your help so far! 

                        • 9. Re: Returning multiple answers from a match field
                          philmodjunk

                               It's not the simplest thing in the world to do. There is more than one way to do this, but I'd suggest setting up a tab control with two pains that show the exact same fields in exactly the same position. Use behavior settings to deny access to the fields on one panel of the tab control and change their font color etc. to grey. Give each tab panel an object name and then a script can use go to object to select a given tab. Thus the button can perform a script that includes that script step.

                               Once your script works to select the correct panel of the tab control, you can make the tab control invisible by changing border and fill color settings. (Don't give them tab labels so that a user can't click them by accident.)

                               You can also use the OnRecordLoad script trigger to perform a script to select the correct panel so that you start with the correct panel each time you access the layout or change records while on the layout.