2 Replies Latest reply on Sep 9, 2013 11:47 PM by SimonSherwood_1

    SUM Portals won't populate with data unless page is clicked elsewhere

    SimonSherwood_1

      Title

      SUM Portals won't populate with data unless page is clicked elsewhere

      Post

           Hi

           I have a database with a main menu Layout (form) that has a couple of single row summery portals on it.  On the page I have a couple of selection fields with value that will alter 2 other fields on which the relationships of the Portals are based.  I have a script set to perform that upon entering the layout the 2 selection fields are set to default values.  I hope this makes sense so far.  All works well I have my drop down value lists and the correct SUM Totals are displayed in the 2 Portals that I have set up.  The problem is that upon entering the Layout the Portals appear empty and I have to click on a space on the layout before any data is displayed in the Portals.

           Is there a way of making the portals populate with data without clicking on a blank space?

            

           Simon. 

        • 1. Re: SUM Portals won't populate with data unless page is clicked elsewhere
          philmodjunk

               "Clicking on a blank space" causes FileMaker to Commit the Parent and Portal records. You can eliminate the need for the mouse click by adding in an OnObjectExit script trigger that does a Commit Records step. Best bet is probably to set this on the portal so that exiting the portal or changing portal rows trips the commit records step. You can also experiment with using it with OnObjectSave on the individual fields, but since this causes the layout to "lose" the portal row focus, the results may not be what you want without some extra scripting to capture the active portal row number and then return the focus to the correct row and field after committing the record.

               And even with the script trigger performed Commit, the summary fields in the portal rows will remain empty while you are editing the values in your portal row fields.

               Another option is to use additional relationships that directly match to the records so that no portal filter (nor any portal at all) is need to match to the different sub sets of records. This requires creating additional table occurrences of your portal's table--each with a different set of match fields, but then you can use calculation fields defined in your layout's table that use Sum or another such aggregate function (count, average, min, max...) to compute the same value. These values will update much more smoothly than your one row portals with a summary field inside them.

          • 2. Re: SUM Portals won't populate with data unless page is clicked elsewhere
            SimonSherwood_1

                 Thanks commit records works a treat.