3 Replies Latest reply on Jun 24, 2014 10:13 AM by DanielShanahan

    Pop-up Menu Display

    DanielShanahan

      On a layout I have a foreign key with a pop-up menu. The menu is defined as follows:

       

      USER::ID

      and

      USER::user

       

      Show values only from the second field.

       

      This works fine when I'm on the field and choose the user via the pop-up. It produces a list of user names, as expected. However, when I script the process and populate the field MYTABLE::userID with $userID, the pop-up displays the id rather than the user's name (see attached screenshots). I know I can fix this with a Dropdown and a mask field, but is there any way to make the pop-up display the second field from the value list?

        • 1. Re: Pop-up Menu Display
          ChadAdams

          Hi Daniel,

           

          I just built a test file here and it worked as I would have expected.  When I set the MYTABLE::userID field to $userID via a script the field formatted as a pop up menu showed the Name of the person, not the ID (exactly NOT what your screen shots are displaying).

           

          I would check the following:

          1. Make 100% sure the ID you are setting does in fact have a related USER record
          2. Double check and make sure the field type for User::ID matches the data that is getting set, looks like you need it to be text
          3. Double check and make sure the variable $userID hasn't been used previously in the script in a way that would make FMP think of it as a number only
            1. I've seen issues where a varialbe gets used as a number and later text is placed in it but FMP treats it kind of like a number field and seems to ignore text characters even though they are still seen

           

          That's all that comes to mind right now.

           

          Good luck,

           

          Chad

          • 2. Re: Pop-up Menu Display
            DanielShanahan

            My mistake.  I figured it out.

             

            I thought I was passing the UUID, but I had concatenated something to the UUID and hand not properly parsed it.  It is working as expected now.

            • 3. Re: Pop-up Menu Display
              DanielShanahan

              Thanks Chad.  It was a developer error!  I thought I was passing the UUID, but I had not properly parsed it.  I grabbed values using eSQL but forgot to specify a carriage return.  So, my $userInfo variable looked like this:

               

              1234-45.., Bob

               

              Instead of this:

              1234-45..

              Bob

               

              Which, of course, made a difference for my next variables:

               

              $$userID = GetValue ( $userInfo ; 1 )

              $$user = GetValue ( $userInfo ; 2 )

               

              It works as expected now.  Thanks for taking the time to test.

               

              Daniel