6 Replies Latest reply on Sep 10, 2009 11:50 AM by macguy0918

    Rookie Question: Display Lookup Value When Code Changes

    macguy0918

      Title

      Rookie Question: Display Lookup Value When Code Changes

      Post

      I have two fields, a Position Code and a Position Title field.

       

      The Position Code field is set up as a Drop Down Selection Field using a lookup table of Positions Codes and Position Titles.

       

      The Position Title field is set up as a non-editable Display Field.

       

      I need to have to the correct Position Title display whenever a user either enters or changes the Position Code field, either by typing in a new value or by selecting a value from the Drop Down list.

       

      I think I can use the OnObjectModify script trigger but I am not sure how to set this all up.

       

      Any help or examples would be much appreciated.

       

      thanks 

       

        • 1. Re: Rookie Question: Display Lookup Value When Code Changes
          comment_1
             I believe you could simply place the Position Title field from the lookup table on the layout of your "other" table.
          • 2. Re: Rookie Question: Display Lookup Value When Code Changes
            macguy0918
              

            I tried that but the behavior is inconsistent.  Sometimes it works and sometimes it doesn't.  Sometimes it doesn't display anything after picking a value from the drop down list of valid values. 

             

            My basic setup is as follows:

             

            I have a table named lov Positions which has three fields:   Position Code, Position Title, Position Category.

             

            In the main data table there is also a field named Position Code.

             

            I have the Position Code field set up on the main data entry form as a Drop Down List using a Position Code List which is set up in the Value Lists using the "Use Values from Field" option and that in turn specifies the Position Code from the lov Positions table.

             

            I have the Position Title field set up as an edit box in which I try to display the lov Positions::Position Title field.

             

            It does not seem to work; it is blank; and I can't figure out why.

             

            Any ideas? 

            • 3. Re: Rookie Question: Display Lookup Value When Code Changes
              comment_1
                 If it doesn't display anything, then either there is no related record in the lov Positions table, or the Position Title field of the related record is empty. It doesn't matter what method you use to display the related data if it's not there.
              • 4. Re: Rookie Question: Display Lookup Value When Code Changes
                macguy0918
                   Well the problem is that there clearly there is data there that should be displaying.  They can't pick a Position Code unless it is in the table, and there are no Position Codes in the lookup table (lov Positions) that do not also have Position Titles.  In fact, I have both the Position Code and the Position Title show up in the drop down list when the user goes to pick a Position Code.  The user sees both the Code and the Title in the drop down list when they pick the code, but the title doesn't display in the field like it should.
                • 5. Re: Rookie Question: Display Lookup Value When Code Changes
                  philmodjunk
                     What relationship have you defined linking the two tables?
                  • 6. Re: Rookie Question: Display Lookup Value When Code Changes
                    macguy0918
                      

                    In the relationships table I have the Position Code in the main data table linked to the Position Code in the lookup table (lov Positions).

                     

                    Oops I just figured it out.  I had two fields set up between the main data table and the lov Positions table, and the second field didn't need to be linked there.  It was just a mistake on my part.  removing the second field link solved the problem!@

                     

                    sorry but thanks for your help.  the discussion helped me focus on the right area and I found the problem as a result.