9 Replies Latest reply on Jul 1, 2009 10:02 AM by synergy46

    Value list displaying PK instead of 2nd field value???

    synergy46

      Title

      Value list displaying PK instead of 2nd field value???

      Post

      I want the popup to insert datafield into field1.fk in the layout. 

      It worked a few hours ago.  Then I changed something (grrrrrr) and can't understand what I did to make it only return the table2::field2.pk

       

      Here is the setup:"

       

      2 tables:

       

         table1:

            field1.fk

       

         table2:

            field2.pk

            datafield

       there is a one to many relationship between Table1 >--------- Table2

       

      In table1 I have a ValueList popup as follows:

           field1.fk get's it's values from table2::field2.pk and table2::datafield

         

           Also Display from 2nd Field is checked.

           Show only from 2nd field is checked.

       

      When I select a datafield in the popup it inserts the table2::field2.pk instead of the table2::datafield.

          

      What is the most likely mistake I MADE in creating this 'anomolie'???

       

       

       

        • 1. Re: Value list displaying PK instead of 2nd field value???
          mrvodka
             Are you sure that you didnt change it from a popup menu to a drop down?
          • 2. Re: Value list displaying PK instead of 2nd field value???
            synergy46
               It is a popup.  I thought I might have screwed up the relationship but that looks ok. 
            • 3. Re: Value list displaying PK instead of 2nd field value???
              mark_d2x
                

              Are you wanting to show a description in the drop down then pull a code from column 2 for a report?

               

              This is what I have done for my look up tables

               

              field 1 - description eg Male

              field 2 - simple code for analysis eg 1

              field 3 - upload code eg "1" (this is for a .csv upload that needs all the entries to be enclosed within "  ")

               

              Then set up a relationship to field 1, with the input field on the layout to display field 1 from the look up with autocomplete turned on.

               

              I set the field in the main table to look up to the second table, displaying the column on the input layout, when I run the report, rather than using the main table I use field 3 from the look up table 

               

              Mark 

              • 4. Re: Value list displaying PK instead of 2nd field value???
                obeechi
                  

                You've got wires crossed, either in your description, or your understanding

                 

                one to many relationship is one parent to many (possible) children.

                 

                each child record will be stamped with the dna of its associated parent record, even if it's a worm record.

                 

                so you want to store a copy of the dna of the parent record in a foreign field in the child record.

                 

                You do NOT want to store a copy of the child records own dna in a field in the associated parent record - child don't birth their parents

                 

                so your drop down value list (or pop up window) will be on a field on a layout based on the child table.

                 

                be careful that the displayed field of said field (we're still in the child layout here) displays its own native foreign field (to hold the copy of the parent id/dna)

                 

                an easy mistake is to choose this 'display' field (which is meant to actually hold the value of the 'copy' after you've made your choice from the value list) from a wrong table or wrong field

                 

                 

                • 5. Re: Value list displaying PK instead of 2nd field value???
                  synergy46
                     ou've got wires crossed, either in your description, or your understanding

                   

                  one to many relationship is one parent to many (possible) children.

                   

                  each child record will be stamped with the dna of its associated parent record, even if it's a worm record.

                   

                  >>>What is a 'worm' record?

                   

                  so you want to store a copy of the dna of the parent record in a foreign field in the child record.

                   

                  >>>Right, my popup valuelist refers to 2 fields in TABLE2 (the One) The firest field is the PK and the second is the value to be 'seen'. 

                  The layout is based on Table1.  The popup field is a FK in TABLE1.  Isn't this correct?

                   

                  You do NOT want to store a copy of the child records own dna in a field in the associated parent record - child don't birth their parents

                   

                  so your drop down value list (or pop up window) will be on a field on a layout based on the child table. 

                  >>>Right

                   

                  be careful that the displayed field of said field (we're still in the child layout here) displays its own native foreign field (to hold the copy of the parent id/dna)

                   

                  an easy mistake is to choose this 'display' field (which is meant to actually hold the value of the 'copy' after you've made your choice from the value list) from a wrong table or wrong field

                   

                  >>>It sounds like your description is the way I have it set up.  What now?

                  • 6. Re: Value list displaying PK instead of 2nd field value???
                    mrvodka
                       Try changing it to a drop down for testing. Does it show both values?
                    • 7. Re: Value list displaying PK instead of 2nd field value???
                      synergy46
                        

                      mr_vodka wrote:
                      Try changing it to a drop down for testing. Does it show both values?

                      I have tried:  drop down; popup; 1st pk only;pk and 2nd field... and nothing seems to matter.

                       


                      • 8. Re: Value list displaying PK instead of 2nd field value???
                        mrvodka
                          

                        Ok so when you use a drop down list, it only shows the first field and not the second field in the chooseable list correct?

                        Double check that the table occurrence that you are using is correct for teh second field (under the also display values for second field checkbox).

                        If you are using the wrong TO or from a related TO, then you may want to double check your relationship.

                         

                        • 9. Re: Value list displaying PK instead of 2nd field value???
                          synergy46
                            

                          Here is the 'actual' application :

                           

                           

                          The problem is that when I select "Include only related values starting from STOCK, I get the "Values undefined" error.