8 Replies Latest reply on Jun 22, 2013 3:05 AM by tays01s

    Portals synchronisation

    tays01s

      Title

      Portals synchronisation

      Post

           If you have 2 or more portals showing information from related tables (1 < 2 < 3) on table 1 and records in the portal from table 2 have >1 related record in the portal from table 3, how do you ensure that, for example, portal for table 3 is showing the records that relate to record currently showing in the portal from table 2?

        • 1. Re: Portals synchronisation
          AppGuy

               This is done in your database relationships.  If you have all your relationships setup correctly the data will all show correctly.  Do you have a more specific question we can help you with?

          • 2. Re: Portals synchronisation
            tays01s

                 I'm new to FM so it's possible my relationships aren't correct, but, when I choose a record for T1, it pulls up the correct records from T2 and T3. Each of the latter appear as 3 records per portal. However, when I scroll down T2, T3 doesn't appear to move in synch, so it's not obvious which record from T3 pertains to that in T2. 

                  

                 How can I make it more obvious? (assuming all's well with relationships!)

            • 3. Re: Portals synchronisation
              philmodjunk

                   With these relationships:

                   Table1----<Table2----<Table3

                   An unfiltered portal to Table3 placed on a layout for Table1 will list all records from Table 3 that link to at least one record in Table2. So if you have 2 records showing in an unfiltered portal to table 2 and the first record links to records, A, B from table 3 and the second links to records Y, Z from table 3, the portal to table 3 will list records A, B, Y and Z.

              • 4. Re: Portals synchronisation
                tays01s

                     OK. I've sorted T2 by 'date_created' and  T3 by 'date_created' then filtered T3 by '_fkT2_ID'. But it's not working yet; what have I missed?

                • 5. Re: Portals synchronisation
                  philmodjunk

                       I don't know what you are trying to do. Your original question stated:

                       how do you ensure that, for example, portal for table 3 is showing the records that relate to record currently showing in the portal from table 2

                       What do you mean by "currently showing in the portal from table 2"?

                       All the records from 2 that are linked to the current record in 1 will be "currently showing" unless you have a portal filter on that portal.

                       "not working" tells me almost nothing.

                       Exactly what relationships and portal filter expressions are you using?

                  • 6. Re: Portals synchronisation
                    tays01s

                         Apologies:

                         T1 < is related to a _fkT1_ID field in T2 and T2 > is related to a _fkT2_ID field in T3.

                         T2 and T3 are sorted by their respective date_created fields.

                         I don't mind all T2 records related to T1 appearing in its portal (unless this impacts the T3 portal). However, if I select a T2 portal record, I'd like only those records related to it to appear in the T3 portal. To attain this I filtered T3 by T2::__T2ID=T3::_T2ID. This failed to do as I just mentioned.

                         Is there any other info you need to help on this?

                    • 7. Re: Portals synchronisation
                      philmodjunk

                           T1---<T2----<T3
                           T1::__pkT1_ID = T2::_fkT1_ID
                           T2::__pkT2_ID = T3::_fkT2_ID

                           

                                T2 and T3 are sorted by their respective date_created fields.

                           I am guessing that you specified a Descending sort order for T2 in the t1---<t2 relationship and the same for T3 in the T2----<T3 relationship. (The portals can also be sorted to produce the same result.)

                           

                                I filtered T3 by T2::__T2ID=T3::_T2ID.

                           I would expect that to limit the records in T3 to just those linked to the "first related record" from T2. Which record in t2 is "first" will depend on whether you sorted the portal or the relationship, but neither is what you want here.

                           You'll need to put a button in the portal to T2 that updates a field or variable to show just the T3 records related to the selected T2 record.

                           Set up this relationship: (I'm using a new Table Occurrence of T3 so that existing relationships need not be changed, that may or may not be necessary. It depends on the overall needs of your database.)

                           T1-----<T3|SelectedT2     (this is a new occurrence of T3)

                           T1::SelectedT2ID = T3|SelectedT2::_fkT2_ID

                           Then a button in the T2 portal can perform this script:

                           Set Field [T1::SelectedT2ID ; T2::__pkT2_ID ]
                           Commit Records--this step may not be necessary

                           And then change your portal to T3 to be a portal to T3|SelectedT2 (Change the fields as well as the portal)

                           IF you want, you can set up all the fields in T2 as your button so that you need only click the portal row and you can set up a conditional format for the fields in T2 so that the fill color changes to show which row was clicked to select the records in the portal to T3|SelectedT2.

                      • 8. Re: Portals synchronisation
                        tays01s

                             Thanks. This link shows some extra tricks:

                        http://www.youtube.com/watch?v=VJqA03X33DQ