6 Replies Latest reply on Jun 17, 2014 2:56 PM by FileMakerNovice

    List relationship not updating portal

    FileMakerNovice

      Title

      List relationship not updating portal

      Post

           Hello,

           I have a two portals that do not update.  Let me explain my tables:

           Employees:  A table of employees
           PossibleResponsibilities:  A table of possible responsibilities that each employee has.
           AssignedResponsibilities:  A table of assigned responsibilities each employee has.

           Relational view:

      Employees                          AssignedResponsibilities       PossibleResponsibilies
           EmployeeID------------------f_EmployeeID
                                                         f_responsibilitieID-------------------------ID

           So... I have a list calculation field in employees called listPossible.  This is defined as list(PossibleResponsibilities::ID; P &". ").  I then have another relationship of Employees to PossibleResponsibilities with this list field not equal to PossRes::ID.  What this gives me is the feature of having a portal that I display the list of all possible responsibilities that are not currently taken by that employee.  I then have a "+" in that portal that copies each ID field and creates new record in the AssignedResponsibilities.  There is then another portal that shows that table with a "-" to delete the record.

           My problem is with the refreshing of these portals.  When adding and removing, the scripting does as it is supposed to BUT the PossibleResponsibilities table does not refresh.  I have attempted to add a "Refresh Window" and "RefreshObject" script.  I also confirmed that the calculation is not stored.  I can navigate to other layouts and come back to this one and it is still not updated.  The only way it updates is when I quit and relaunch.

           Is there any trick to refreshing a portal that has a calculated list relationship?

        • 1. Re: List relationship not updating portal
          philmodjunk

               Try using Commit Records instead of Refresh Window. You can test this situation without changing your database by clicking a blank area of the layout background to commit records. If you click either + or -, then click a blank area of the layout and then the portal's update, you just need to include Commit Records to your script.

               You may need commit records followed by Refresh Window.

          • 2. Re: List relationship not updating portal
            FileMakerNovice

                 Wow.  Thanks for the quick response.

                 Excellent thought, unfortunately, the do not include portal still does not update.  This did however fix another script I had.  Previously, to get the list to update, I went to the next record and then previous to commit.  Had a couple refreshes thrown in there but the commit step allowed me to remove 4-5 lines of the script.  That's always good.

                 So... the list field is correct but the relationship does not seem to update.  I did find out that if I go into the "Manage Database" and then back out, the portal will update.

                 EDIT:  I've also noticed that it will refresh by waiting about 2 minutes and then running a script that goes to a different layout and comes back and refreshes the window.

            • 3. Re: List relationship not updating portal
              philmodjunk

                   Is the portal filtered?

                   Does refresh window [flush cached join results]

                   make it work?

                   I don't recommend this option as a permanent "fix", but if that works, it provides us with a useful clue here.

              • 4. Re: List relationship not updating portal
                FileMakerNovice

                     I've experimented with and without filtering.

                     I completely forgot about the flushing cached join results option.  This worked without issue.  This particular layout and scripting is used very rarely, perhaps a dozen times a year.  Is there a more permanent solution?  Due to the rarity of use, I am perfectly fine with the flushing solution.

                • 5. Re: List relationship not updating portal
                  philmodjunk

                       It's a matter of how long it takes for the window to refresh. This option can, under certain circumstances, result in long delays waiting for the screen to update--particularly if you have one or a combination of the following:

                       A Remotely located host computer (such as from a hosting service)

                       A very large set of related records in the portal--especially if there is conditional formatting set up on fields in the portal row.

                       iOS based clients using FM GO

                       But what you report is consistent with having a portal filter set on your portal where data changes require that the filter expression re-evaluate in order to update what records are allowed to show in the portal. But when that is the case, there are alternate approaches that can be used in place of Refresh Window[ flush...

                  • 6. Re: List relationship not updating portal
                    FileMakerNovice

                         Yeah.  The EDS is half way across the country.  There's only going to be a max of 10 or so related records, per each record, in this reference.  Also, we do not currently have FM GO involved, and it is doubtful that this portion would ever be accessed from an iOS device.

                         I think your solution will work great.  Thanks again.  Have a good on.