4 Replies Latest reply on Sep 21, 2012 9:37 AM by philmodjunk

    Drop Down Value List using Calculated Field



      Drop Down Value List using Calculated Field


           Two fields:

           Category = 3 (example)
           Category Description = Women's Accessories
           I created a calculated field that combines these two to be 3 - Women's Accessories
           I want to create a drop-down menu using this field as the value list but users can't select anything because it is a calculated field. How do I avoid this? I thought about a merge field, but that isn't really a field.
           Once that part is fixed I need the user to be able to select something from that drop-down list and then a script will run to find those records on a particular layout. Is that just a set-field within in the script?
           Sorry, I'm sure the answer is on the forum somewhere but I am up against a tight deadline.

        • 1. Re: Drop Down Value List using Calculated Field

               I answered the first part by changing the type of field and the options. But I could use some help on the find script. Thanks!

          • 2. Re: Drop Down Value List using Calculated Field

                 It sounds like you've formatted the wrong field with your value list. The calculation field should not be set with this value list.

                 I suggest defining a value list with the use values from a field option and specify category as the first field and Category Description as the second. This will produce a value list that displays both number and description but enters the number when a value is selected. This removes the need for your calcuation field to combine the two.

            • 3. Re: Drop Down Value List using Calculated Field

                   Thanks Phil, I never thought of that. But it does appear that when I create a field called Cat_Desc and set it up as a auto-calculated result, that works.

                   Now, for the big question. Can I create a script that will find records on another layout based on the selection in this value list? It doesn't have to be right at the moment that they choose the category (or script trigger), it can be another button that says "go" or something. 


              • 4. Re: Drop Down Value List using Calculated Field

                     If you set it up with a field that has global storage specified, a script can enter find mode and use a set field step to use the data in the global field to create the needed search criterion. A script trigger on the field can be used to perform the script immediately after you select a value or you can use a button to perform the script.

                     Enter find mode[] ---> clear the pause check box
                     Set Field [YourTable::Field ; YourTable::GlobalDropdownField ]
                     Set Error capture [on] --> keeps a system error dialog from interrupting the script if no records are found
                     Perform Find []

                     To see a number of different examples of how a set field step can specify search criteria, see this thread and check out the sample script found near the beginning of the thread: http://forums.filemaker.com/posts/ba7347f58a