6 Replies Latest reply on Feb 4, 2014 8:40 AM by tobiasj

    Displaying Unrelated Records in Portal

    tobiasj

      Title

      Displaying Unrelated Records in Portal

      Post

           I feel almost embarrashed to post about a question which seems to have been answered twice already.

           Here: Unrelated Table in Portal

           And Here: Browsing Unrelated Records - Portal?

            

           Try as  I might, I just can't make these solutions work for me. Probably I'm doing something wrong. 

            

           I have included an image of the pertinent relations of my tables. The 'Files_ref' table addresses the many-to-many relationship arising from the fact that each record can be associated with many files, and each file can be associated with many records.

           What I'm looking to do, is to display all files in a portal - not just those associated with the current record (assetbase::id).

           As you can see, I'm been attempting to accomplish this with a new occurence of the Files table (Files 2), but for the life of me I can't figure how to relate it properly. Have a hard time coming to terms with not only several occurrences of the same table, but also them having different relations.

            

           Any and all tips would be greatly appreciated!

            

      Tables.png

        • 1. Re: Displaying Unrelated Records in Portal
          philmodjunk

               And on which of these table occurrences is your layout based? AssetBase?

               If so, drag from any field in Files 2 to any field n AssetBase.

               Double click the relationship line and change the default operator from = to X (cartesian join).

               Then put a portal to files 2 on your AssetBase layout and it will list all records from Files.

          • 2. Re: Displaying Unrelated Records in Portal
            tobiasj

                 Hi Phil, thanks for your reply :-)

                  

                 The layout is based on the 'Resistor' table (not shown, but similar to Capacitor table), but I gather it amounts to the same thing, since AssetBase::id = Resistor::id

                 I have tried several combinations of relations between the Files 2 table and the AssetBase table, and I've changed the relation type to cartesian join, but they all result in the same thing:

                 The portal displays 39 rows of the same file. There are currently 39 tuples in the Files 2 table.

                  

                 PS: Relating directly to the Resistor table yields same result as above.

            • 3. Re: Displaying Unrelated Records in Portal
              philmodjunk

                   Then you need to link Files 2 using the X operator to the Resistor table, not the AssetBase table.

                   When you set up the portal, make sure that you add field to the portal row from Files 2, not File--which is what it sounds like you have done from the description given.

                   

                        but I gather it amounts to the same thing, since AssetBase::id = Resistor::id

                   Not really the same thing. If you link Files 2 to AssetBase, then the records in Files 2 will not appear on your Resistor layout unless there is also a matching record in AssetBase that links to your current record in Resistor.

              • 4. Re: Displaying Unrelated Records in Portal
                tobiasj
                     

                Not really the same thing. If you link Files 2 to AssetBase, then the records in Files 2 will not appear on your Resistor layout unless there is also a matching record in AssetBase that links to your current record in Resistor.

                But there would be matching records, since the two ids are exactly the same (always). Right?

                      

                I have set up the relation as shown below, and double-checked that the portal is working on the Files 2 table. Still, I get the same 39 instances of the same row.

                Maybe I should meantion that both 'Files' and 'Files 2' tables are referring to a table in another file. Don't think it matters, but better safe than sorry :-)

                • 5. Re: Displaying Unrelated Records in Portal
                  philmodjunk
                       

                  But there would be matching records, since the two ids are exactly the same (always). Right?

                  Not right. This will only be the case if you take the needed steps to insure that. Just the existence of this relationship is not enough to guarantee that there will always be a matching record in AssetBase for every record in Resistor.

                       

                  and double-checked that the portal is working on the Files 2 table.

                  But I asked you to double check that the FIELDS are from Files 2. It sounds like your fields are from Files. Click a field in the portal row while in layout mode. Check "Display data from" in the Inspector's data tab to see if the text to the left of :: in this box is Files 2. I predict that they'll show some other name such as Files there instead.

                  • 6. Re: Displaying Unrelated Records in Portal
                    tobiasj
                         

                    Not right. This will only be the case if you take the needed steps to insure that. Just the existence of this relationship is not enough to guarantee that there will always be a matching record in AssetBase for every record in Resistor.

                    No ok, I guess I wasn't very clear with my 'always' parenthesis. I meant exactly that. Have gone to great pains to ensure that there is always a matching assetBase record for each resistor record and vice versa. But works well, so was well worth the trouble :-)

                          

                    Thanks for clarifying about the fields. Its works like a charm now!

                          

                    Thanks for your time and patience!