7 Replies Latest reply on May 20, 2010 2:55 AM by LaRetta_1

    Go to related record from same layout

    millebjoerk

      Title

      Go to related record from same layout

      Post

      Hi!

       

      I have a database with many participants participating many different trips. People match different trips and in the "trips-layout" I have created a list of the participants related to a specific trip in a portal. Now i would like to have a drop down list in the participant-layout from where you can choose between all the participants on the same trip, in the case that you have joined the trip together with some else. That I have done through a dynamic value list, which works.

       

      Now what I want to do is to be able to click on a participant's travelling body and then turn to the travelling body's record. I have tried to create a script which says that if the field is empty then enter the field (and then choose the travelling body). If else (menaning if the field already contains a travelling body) then go to related record (meaning go to the travelling body's record). This does not work. I have made the relation between the the two fields in the relationsships of the database, by putting a relation between this particular field called "travelling body" and the field from which the value list is created called "name". And it still doesn't work..

       

      Can anyone help me with this?

       

      Best, Mille

        • 1. Re: Go to related record from same layout
          comment_1

          We need some names here, in order to be clear. So let's say your participants are in a People table, and the field you have used to select the other person is called Selection. Assuming you have defined a self-join relationship of the People table as:

           

          People::Selected = People 2::Name

           

          you can now Go to Related Record [ From table: People 2 ; Using layout: <Current layout> ]

           

           

          Note: It's not good practice to use names for relationships - you should use unique ID's instead.

          • 2. Re: Go to related record from same layout
            millebjoerk

            Thank you for clerifying what I mean :-)

            You got it all right and that is exactly what i have done, and yet it still doesn't work, I'm wondering whether I have missed somthing in the script or wether there is a problem with the value list in the field Selected (as you calle it)...?

            • 3. Re: Go to related record from same layout
              comment_1

              I don't think the value list plays a part in this; as long as you do have a value in the Selected field, it doesn't matter how it got there. What exactly does "doesn't work" mean?

              • 4. Re: Go to related record from same layout
                millebjoerk

                Now it works!!!

                 

                I found out that I forgot to put an arrow in "Allow creation of records in this tablevia this relationship" for both tables. So now it is good!

                 

                Thanks for all your help!

                • 5. Re: Go to related record from same layout
                  comment_1

                   


                  millebjoerk wrote:

                  I found out that I forgot to put an arrow in "Allow creation of records in this tablevia this relationship" for both tables.


                  I don't see how that would help with the problem you have described. In fact, I don't think it's a good idea to enable those options for this relationship.

                   


                  • 6. Re: Go to related record from same layout
                    millebjoerk

                    I don't why - but after i did that it worked.. so..

                    • 7. Re: Go to related record from same layout
                      LaRetta_1

                      Just because something works doesn't mean it works properly.  And there is a difference between whether something will work and whether something is a good idea.  You should step back now and try to understand what works, why it works and whether you have it properly configured. 

                       

                      If you do not, then you will continue to build your solution and, after putting in another weeks' worth of work, you will discover you connected it improperly and you will have to undo all of your work and start that portion again.  I call it unraveling your knitting and it is a waste of time.  And if you ignore 'why it seemed to work even if not suggested and you have no idea why' then you will not learn for the next time you need something similar.

                       

                      UPDATE:  If you want to be sure it is a good base from which to continue building, upload the file to a free file sharing site and ask for input on it.