1 2 Previous Next 19 Replies Latest reply on Jan 6, 2011 2:32 PM by davec

    Show only related records through portal

    davec

      Title

      Show only related records through portal

      Post

      Hi all,

      I'm very frustrated at the moment and I'm sure there's an easy solution to this...

      What I have is a database of people and organizations. They are linked with a peopleOrg table for the many-to-many relationship. On the People layout I have a portal of the peopleOrg data and some of the Org data also. What I want to do is have a "Go to related record" button and only show the related records (i.e. those that show up in the portal). However, when I try this it shows ALL the Organizations.

      What could I be doing wrong?

      Thanks in advance,

      Dave

        • 1. Re: Show only related records through portal
          Rajkumar

          There might be problem in your relationship. Make sure for the correct relationship between two tables.

          An eg: consider the table A and a table B, and if u want to have some data in the portal in table A, then u need to create a field(which'll be a foreign) in table A, and relate with a primary key field in B. By doing this way, u can have data of those fields of B in the portal of table A, which are related to each other.

          • 2. Re: Show only related records through portal
            davec

            Thanks Raj. My relationship is sound. The people and org tables have and ID field and the peopleOrg table has orgID and peopleID fields to make things work. I'm comfortable that everything is right because the organizations show up correctly in the portal. Is there any other possible reason that the GTRR script shows all the records and not only the related ones?

            Thanks,

            Dave

            • 3. Re: Show only related records through portal
              Rajkumar

              The portal shows all the records which are related to the specified table through the relationship criteria. So the only possible reason of showing unrelated data is, u have had mistake while making the relationship, so check it.

              • 4. Re: Show only related records through portal
                philmodjunk

                You should have three tables: People----<PeopleOrg>----Organizations

                You have a portal to PeopleOrg from People and want the list of organizations to which the current people record is linked.

                If I have described your system correctly, GTRR should work for this. Since it isn't, please post your GTRR script step listing all its parameters. Maybe there's a missing/incorrect detail there that's affecting its function.

                • 5. Re: Show only related records through portal
                  davec

                  Hmmmm...

                  I think I know what's going on. But I'm not sure how to fix it best.

                  The database is a little more complex than just people and organisations (there are also tasks and pictures and emails and equipemnt etc.). In order to not have circular references I made a second people table in the ER diagram (people4Orgs). So when I tried to go to the related record using the layout that was based on the [original] people table it didn't like me. Could this be the issue?

                  I can think of two ways to overcome this but am not sure either are great:

                  1) Create duplicate layouts for both tables and go to the "right one"

                  2) Script my way around it using finds

                  Is there a better way I could design the database or am I missing something?

                   

                  Thanks so much for your help!

                  Dave

                  • 6. Re: Show only related records through portal
                    philmodjunk

                    One of the oddities of Go To Related Record (GTRR) is that you can specify any layout that refers to the same data source table and it should work as long as you select the correct table occurrence. Specify the Table Occurrence that's related to your current layout's table occurrence in "get related record from", but then specify any layout with the same data source table as the Table Occurrence you specified in show record using layout:

                    (Table Occurrences are the "boxes" found in Manage | Database | Relationships. Any layout is linked to one of these in the Show Records from drop down found in Layout Setup... )

                    • 7. Re: Show only related records through portal
                      davec

                      OK - so it wasn't what I thought then. Makes sense as I have other GTRR for similar things that work fine. This is a frustrating mystery then.

                      I absolutely chose the related TO to go through and the layout I wanted was part of the same table (although not the TO as I thought might have been the problem).

                      The portal in People (to the TO of Orgs) shows the correct data (i.e. only some of the Organsiations). However, the button with the GTRR script (set to go through to the TO of Orgs and use the Org layout) does not seem to undersand the "show only related records" setting. While it takes me to the "correct" Org (i.e. the one for which portal row the button is in), it will always show all Orgs in the found set.

                      What am I missing here?

                       

                      Thanks for all your input - I really appreciate it. Sorry to be so rusty - it's been a while and I feel like a noob: I'm sure there's a simple solution to this.

                      Dave

                      • 8. Re: Show only related records through portal
                        philmodjunk

                        Is the TO listed in Layout Setup... related to the TO you specified in the GTRR step?

                        If so, is this the relationship?

                        LayoutTO for People----<People_Org>------GTRRTarget TO

                        • 9. Re: Show only related records through portal
                          davec

                          Yip.

                          The relationship is:

                          People --< People_Org_TO >-- Org_TO

                          The script specifies GTRR from Org_TO on the People layout.

                          I have a portal on the People layout using People_Org_TO which shows data from Org_TO and works great.

                          • 10. Re: Show only related records through portal
                            philmodjunk

                            I have a demo file I suggest that people download when they are having issues with a Many to Many relationship. When I put a GTRR script in this file and test it, it works for me with no issues.

                            What are relationship details linking the three tables?

                            Like this?

                            People::PeopleID = People_Org::PeopleID
                            Org::OrgID = People_Org::OrgID

                            I'm wondering if the issue is in the relationship from the join table to Org as that issue might not be visible in your portal.

                            • 11. Re: Show only related records through portal
                              davec

                              Yes:

                              The relationships are:

                              People::P_ID = PeopleOrg_TO::P_ID

                              Org_TO::O_ID = PeopleOrg_TO::O_ID

                               

                              Curiously I have the same problem going the other way (Org -> People) where the relationships are

                              People_TO::P_ID = PeopleOrg::P_ID

                              Org::O_ID = PeopleOrg::O_ID

                              I'm sure they're the same problem but I can't figure it out. Thanks so much for your help- I really hope I can crack this: it's doing my head in.

                              Dave

                               

                              • 12. Re: Show only related records through portal
                                philmodjunk

                                Does a portal to PeopleOrg placed on an Org layout show the correct records?

                                Can you upload a copy of the file to a share site and post the download link here for me to take a look? Maybe I can spot some niggling detail that you missed.

                                • 13. Re: Show only related records through portal
                                  davec

                                  Yes - the portals work fine: that's why I've been scratching my head for so long.

                                  I've sent you a PM with a pick-up address as I'd prefer the database not be so public. I really hope it's a simple oversight and we can all learn from it.

                                  Cheers,

                                  Dave

                                  • 14. Re: Show only related records through portal
                                    philmodjunk

                                    Found it. In the GTRR step specify Match Current Record Only not Match all records in current found set.

                                    This option refers to the records on your people layout--not the records in the target table.

                                    1 2 Previous Next