4 Replies Latest reply on Jun 27, 2016 5:57 AM by Magnus Fransson

    Smarter drop down menus

    dkantor

      I would like to create drop down menu using a value list that is prone to change. For example, I would like to assign a teacher to a student in the student's record. The student record would include an assigned teacher field that has drop down listing of teacher names that one can choose from.  However, the teacher value list should only include active teachers. It should not include teachers that are currently inactive (such as teachers who are on sabbatical). I understand there needs to be relationship between the student table and teacher table, but I'm not sure how to create the value list for the drop down menu. Thanks in advance.

        • 1. Re: Smarter drop down menus
          dkantor

          I think I figured it out. I created an if/then calculation tile and then referenced it in a value list (if teacher status is active then teacher name).

          • 2. Re: Smarter drop down menus
            Magnus Fransson

            Hi dkantor,

             

            Correct!

             

            But to do things slightly more complex, you should do the same thing with the teachers ID field. And then use both those fields in the value list. (Active ID:s as first and active Names as second.) That is because you always should use ID/key-fields for relations in databases. (You might later realize that some one has spelled a name wrong and like to correct that. Imagine what would happen to all old relations if you did.)

             

            With best regards Magnus Fransson.

            1 of 1 people found this helpful
            • 3. Re: Smarter drop down menus
              dkantor

              OK, the real scenario is as follows: I'm creating a jobs list. Every job can be assigned to a project. So in the Jobs form, I am trying to create a Projects drop down menu that lists only ACTIVE projects. I have created a relationship between the two tables (Projects and Jobs). But I can't seem to get the drop down menu to work properly. Would it be easier if I just sent you my FM file to have a look? It's a small file. Is that OK to do? Not sure about protocol here, but I'm sure you'd be able to see the flaw within seconds. THANK YOU for your help with this!

              • 4. Re: Smarter drop down menus
                Magnus Fransson

                Hi dkantor,

                 

                So. Active was only first level of filtering.

                Next level is using related records. (See picture. (In Swedish though.))

                 

                • In the top you choose the Table Occurrence (TO) that represent what is related where (the TO that the layout is based on) it is being used.

                • Further down, you select the TO that the layout is based on.

                Skärmavbild 2016-06-27 kl. 14.26.26.png

                I realized it looks more complicated in text, then it is in reality.

                 

                Still... Hope that it helps.

                 

                With best regards Magnus Fransson.