5 Replies Latest reply on Apr 18, 2016 11:36 AM by cillion

    View another value that the one inserted in the database

    cillion

      Hi.

      I have a working relation database, but when it comes to choosing a user from a user table. then I have a relationship with the ID of this table. From another related table, how can I let the users choose the ID of this users and put it in the database, but visible for the users they see the username not the ID/foreign key?

        • 1. Re: View another value that the one inserted in the database
          karimhanafi

          HI,

           

          One way to do that is to set up value list based on the relationship and select the username as the show values from another field. Then you have an option to show only the values from the second field.

           

          HOpe that helps.

          • 2. Re: View another value that the one inserted in the database
            peterbouma

            First, create a value list using the ID field from the related table, but check 'Also display values from second field', where you select the (human-readable) name field in the right column. Also check 'show values only from second field' below.

            Then format a popup menu with this value list. It will show only the second field, both in the popup menu and as the chosen value after selecting it. Under the hood, however, FM will store the ID field that establishes the relationship.

            Peter

            • 3. Re: View another value that the one inserted in the database
              cillion

               

              First, create a value list using the ID field from the related table, but check 'Also display values from second field', where you select the (human-readable) name field in the right column. Also check 'show values only from second field' below.

              Then format a popup menu with this value list. It will show only the second field, both in the popup menu and as the chosen value after selecting it. Under the hood, however, FM will store the ID field that establishes the relationship.

               

              This worked with popup menu, but not dropdown. Still I have the same problem when printing this information in the column. Only showing the ID. How can I fix that?

              • 4. Re: View another value that the one inserted in the database
                peterbouma

                Unfortunately, in a drop-down list this doesn't work, as you noticed. The dd list will work, but the result after making the coice is a visible ID. Maybe we should make a feature request at FM for that option too...

                In the meantime, you might try stacking fields on top of each other. The bottom field is enterable, and has the drop-down, The field on top is the name field from the other table. Make that top field not enterable, and change it into a button that makes you enter the bottom field.

                One caveat: this won't work in Webdirect, because objects can't (or shouldn't) be stacked on top of each other.

                 

                Peter

                • 5. Re: View another value that the one inserted in the database
                  cillion

                  Thanks for a good answer I can make a feature request at FM for this.