5 Replies Latest reply on Mar 27, 2012 4:30 PM by comment

    Script to select dynamic value list

    eaglmtn

      Not sure how to search for an answer to this one so will throw it out for discussion.

       

      I'm trying to create a script where, based on a selection (Staff or Guest) it chooses the appropriate pop up menu dynamic value list. Bottom line is I want the field--or variable-- "speaker" to pop up a list of staff members if the Staff button is clicked and pop up a list of guests if the Guest button is clicked. Then, when the speaker selection is made from the pop up list, it will post to the (real) speaker field.

        • 1. Re: Script to select dynamic value list
          ariley

          The way I approach these situations is by scripting it.

           

          I go and build a list of staff in a hidden window. Grab the IDs and names into global variables.

          Show a pop-up window with the SimpleDialog plug-in to allow the user to choose from the staff members.

           

           

          Grab the ID of the chosen staff member and then go create the record with the ID of the staff member. Sometimes I store the name, too, so I can use the indexed text field.

           

          Here's an example of such a dialog:

           

           

          Screen Shot 2012-03-18 at 2.16.09 PM.png (http://cloud.zerobluetech.com/1V302h00263H192P3a0J)

           

          Best regards,

           

          agnes b. riley . filemaker and web development

          FileMaker Business Alliance . FileMaker Technical Network

          www.zerobluetech.com (http://www.zerobluetech.com)

           

           

          T 201-299-6223 (NJ) .

          212-842-8830 (NY)

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

          .

          917-660-7221 (C)

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

          FileMaker Certified in 10 and 11

          people + products + events + todos + invoices + documents = productivity

          • 2. Re: Script to select dynamic value list
            eaglmtn

            To clarify a bit... I have ALL the "speakers" in a separate "speaker" table where they are checked (1 or true) for either staff or guest. I also have an "active" field for each person. Since we are getting new guests regularly and staff changes ocassionaly, I have dynamic value lists for each. i.e. Staff person must be "active" and checked as "staff" to show up in the list.

             

            I also have two other buttons that represent the two most common speakers. There's a script on these buttons that if either is selected, it posts their speaker ID number to the "speaker" field. This is working great and I can toggle back and forth fine for those two speakers.

             

            However I program this additional selection will eventually post to that same "speaker" field. So, if they select Main1 button, that person's ID is put in the speaker tab. Same with Main2. If they click the Staff or Guest buttons, they will be presented a list of staff or guests (whichever is appropriate) to choose from via the dynamic value list. The chosen person's ID will then be posted to the "speaker" fileld. What this does is give me ONE field to search for speakers--and I have a drop-down list of the full list of speakers.

            • 3. Re: Script to select dynamic value list
              ariley

              You can generate the list from a value list, as well.  

               

              Please post a picture of your layout. I am not sure what the problem here is. 

               

              agnes b. riley . filemaker and web development

              FileMaker Business Alliance . FileMaker Technical Network

              www.zerobluetech.com (http://www.zerobluetech.com)

               

               

              T 201-299-6223 (NJ) .

              212-842-8830 (NY)

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

              .

              917-660-7221 (C)

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

              FileMaker Certified in 10 and 11

              people + products + events + todos + invoices + documents = productivity

              • 4. Re: Script to select dynamic value list
                BruceHerbach

                If you have a table with speakers and another table with guest then you can creat a list based on the table.  You can have the list be conditional by using a relationship to filter the list.

                 

                HTH

                • 5. Re: Script to select dynamic value list
                  comment

                  eaglmtn wrote:

                   

                  I'm trying to create a script where, based on a selection (Staff or Guest) it chooses the appropriate pop up menu dynamic value list. Bottom line is I want the field--or variable-- "speaker" to pop up a list of staff members if the Staff button is clicked and pop up a list of guests if the Guest button is clicked.

                   

                  You do not need a script: you need a relationship. Suppose you have a table of Lectures and a table of Speakers, with these fields:

                   

                  Lectures:

                  LectureID (auto-enter serial number)

                  SpeakerID

                  SpeakerType

                   

                  Speakers:

                  SpeakerID (auto-enter serial number)

                  Name

                  Type

                   

                  and the following two relationships:

                   

                  Lectures::SpeakerID = Speakers::SpeakerID

                   

                  Lectures::SpeakerType = Speakers 2::Type

                   

                   

                  Define a value list using values from field  Speakers 2::SpeakerID, also show values from Speakers 2::Name, include only related values starting from Lectures. This value list will change dynamically according to the type selected in the SpeakerType field in Lectures.

                   

                   

                   

                  ----

                  P.S. You don't need any plugins for this, and all your speakers can - and should - remain in the same table.

                   

                  Message was edited by: Michael Horak