13 Replies Latest reply on Sep 2, 2015 4:20 PM by alquimby

    Value List and Drop Down List

    director@charlesmoore.org

      I have a value list for "Warranties", based on a Table, where the first field is the pkID warranty-1000 and the second field is the name of the warranty.  I have selected "Show values only from second field".

       

      I then created a field (labeled in the examples I'm attaching as "Select a Warranty for this Proposal" so the user can choose a warranty, formatted as a drop down, based on the value list.

       

      While the drop down list does indeed show only the value from the second field, when the selection is actually made, pkID (first field) is displayed, which will be confusing to my users.  Is there a way to specify that the second field is the one that should be shown all the time?

       

      See screen shots....  THANKS for any tips.

        • 1. Re: Value List and Drop Down List
          steveromig

          I have a value list for "Warranties", based on a Table, where the first field is the pkID warranty-1000 and the second field is the name of the warranty.  I have selected "Show values only from second field".

           

          I then created a field (labeled in the examples I'm attaching as "Select a Warranty for this Proposal" so the user can choose a warranty, formatted as a drop down, based on the value list.

           

          While the drop down list does indeed show only the value from the second field, when the selection is actually made, pkID (first field) is displayed, which will be confusing to my users.  Is there a way to specify that the second field is the one that should be shown all the time?

           

          See screen shots....  THANKS for any tips.

           

          Try using a pop-up menu instead of a pop-up list.

           

          The behavior you describe has been the behavior for as long as I can remember.  I think the rationale behind it is that a "list" is more conducive to added values to the "list" that are not there and that it would be confusing to show "other values. 

           

          The only downside to the menu method would be if you have a lot of values in which case the menu would / could be quite long.  In cases like this you could include a "Select" button (for example) and pop open a window or popover or something to allow for selecting of values.

           

          Steve Romig

          FileMaker, Inc.

          • 2. Re: Value List and Drop Down List
            keywords

            The method I use for this situation is to place the warranty name field directly on top of the pkID field, but uncheck all the field entry options. This means that when you click on the field the cursor goes straight to the field below, which has the value list. I also use a script trigger to exit the ID field on modification, so that the name in the upper field immediately appears.

            See attached demo file.

            • 3. Re: Value List and Drop Down List
              DanielShanahan

              If the warranty name is unique then it can serve as a key.  It looks like you have a join table, so it could look like this:

               

              PROPOSAL  ---< PROPOSALWARRANTY >--- WARRANTY

               

              Where PROPOSAL::pkID and WARRANTY::warranty serve as the foreign keys in the join table.

              • 4. Re: Value List and Drop Down List
                DanielShanahan

                Sorry - I didn't complete my thought...

                 

                Using WARRANTY::warranty would allow you to keep the Drop-down menu.  There is another advantage of a Drop-down over a Pop-up: the Drop-down enables users to type in values.  This is a great time saver for users who like to keep their hands on the keyboard.

                • 5. Re: Value List and Drop Down List
                  director@charlesmoore.org

                  That's a good idea.  Thanks so much.  One question.  If the user decides later to change the name of the Warranty (which would now be the key field) can one specify that the corresponding field in the join table or related tables change as well?  (If they don't change, then the relationship will be severed.)

                  • 6. Re: Value List and Drop Down List
                    ChadBarnard

                    steveromig is right.  Use a "pop up menu" instead and it fixes your problem.

                    • 7. Re: Value List and Drop Down List
                      ChadBarnard

                      Unless you code it not to, the default settings will always change the corresponding field in all related tables.

                      • 8. Re: Value List and Drop Down List
                        DanielShanahan

                        director@charlesmoore.org wrote:

                        f the user decides later to change the name of the Warranty (which would now be the key field) can one specify that the corresponding field in the join table or related tables change as well?

                         

                        It is a good question.  You're right, the relationship will break if you change the name of a warranty.  There are a couple of ways around this:

                         

                        1. use an OnObjectEnter and OnObjectSave triggers on WARRANTY::warranty to capture the value before the change and after the change.  The OnObjectEnter value ("before" value) would be stored in a global variable $$beforeValue.  The OnObjectSave would trigger a script to find all $$beforeValues in the join table and save them to the $afterValue.  I like to clear out the global variables when I'm finished so the end of the OnObjectSave script would have something like

                         

                        Set Variable [ $$beforeValue; "" ]

                         

                        2. create an auto-enter field in PROPOSALWARRANTY::fkID_warrantyID.  This field would populate with WARRANTY::pkID once the warranty is selected.  In a way, it's a bit backwards to populate the id after a text field.  But it does allow you to do the following:

                        A. Use the warranty for data entry.

                        B. create a relationship based on the ID which wouldn't change.

                        • 9. Re: Value List and Drop Down List
                          alquimby

                          If you don't like stacking fields in layout mode, I changed keyword's excellent example a bit to show another method that still gives the user the impression they are looking at only 1 field. I changed his Notes a bit also.

                          • 10. Re: Value List and Drop Down List
                            keywords

                            Nice Allen. I like that method.

                            • 12. Re: Value List and Drop Down List
                              director@charlesmoore.org

                              Thanks so much.  That's clever.  But one question.  How do you make the field ::warrantyName unenterable.  My relationship is not a simple many-to-many but is defined as:

                               

                              Proposal :: join warranty :: warranty :: warranty pages

                              • 13. Re: Value List and Drop Down List
                                alquimby

                                Keywords made it non enterable, but it is a good idea since the user is actually selecting an ID from the value list. But to answer your question, go into layout mode, use the Inspector, click the Data tab, and deselect Browse Mode and Find Mode under Behavior > Field Entry.