9 Replies Latest reply on Jan 30, 2012 9:11 AM by mike.goss@citta.co.uk

    Total fields in portal as they are entered

    mike.goss@citta.co.uk

      I need a field in a layout to total fields in a portal.

       

      I have set up the required relationships and a sum field. It is update correctly when the the laoyuot is saved, but I need it to update as new records are created via the portal - help please.

       

      This is FP9

        • 1. Re: Total fields in portal as they are entered
          RayCologon

          mike.goss@citta.co.uk wrote:

           

          I need a field in a layout to total fields in a portal.

           

          I have set up the required relationships and a sum field. It is update correctly when the the laoyuot is saved, but I need it to update as new records are created via the portal - help please.

           

          This is FP9

           

          Hi Mike,

           

          You haven't said how you defined your sum field, and by "when the layout is saved", I'm guessing you mean when the record is committed?

           

          However, an unstored calculation defined to produce a sum of related values using the same relationship as the portal should update automatically as soon as you exit a field after editing it - ie if you set it up this way, you shouldn't have to commit the record to see the total update to include a new or edited value on a portal row.

           

          I'm attaching a very simple example that is set up the way I've described, and it works correctly (the total updates as soon as you exit a portal field after making a change) on FileMaker 9 and also FileMaker 11.

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------

          • 2. Re: Total fields in portal as they are entered
            mike.goss@citta.co.uk

            Thanks - downloaded and working exactly how I would wish. Now to find the relevant difference between mine and yours..... watch this space

            • 3. Re: Total fields in portal as they are entered
              mike.goss@citta.co.uk

              OK - some progress.

              The database I was working with has the tables separated into a different .fp7 file, and that seems to be the problem.

              If I take your example PortalTotal.fp7 and separate the tables out to PortalTotal - Data.fp7 the update of the total field as new records are added to the portal no longer works

               

              Is there a way round this - I need to have the data files stored in a separate .fp7 file to faciliate updates on a live system.

               

              Mike.

              • 4. Re: Total fields in portal as they are entered
                RayCologon

                Hi Mike,

                 

                Providing the tables remain in the same file (as each other) and are accessed from the interface file via a single External Data Source entry - and provided the Sum( ) function references the related data a relationship that mirrors the definition of the interface file relationship the portal is based on - changes to values on existing portal rows should result in the total updating 'live' regardless of whether you're using data separation.

                 

                If your solution doesn't match the points I've mentioned above, depending what other factors are in play, the refresh behavior can be affected, but data separation alone should not prevent a portal total from updating to reflect changed values in existing rows.

                 

                Regards,

                Ray

                ------------------------------------------------

                R J Cologon, Ph.D.

                FileMaker Certified Developer

                Author, FileMaker Pro 10 Bible

                NightWing Enterprises, Melbourne, Australia

                http://www.nightwingenterprises.com

                ------------------------------------------------

                • 5. Re: Total fields in portal as they are entered
                  mike.goss@citta.co.uk

                  Ray, thanks for your help on this.

                  I unzipped the file.

                  Opened PortalTotalInterface

                  Records | New Record

                  Entered a key, and then started entering data in the portal and the total was not updated. The same behaviour I'm seeing on my database.

                   

                  Mike

                  • 6. Re: Total fields in portal as they are entered
                    Stephen Huston

                    Hi Mike,

                     

                    The portal data has to be committed before it can update. Sometimes a Refresh Window script step including Flush Cache has to be invoked as well to update a field outside the portal which summarizes it.

                     

                    I sometimes have added a "Save" button just to call that script step to force the refresh and update.

                     

                    Stephen Huston

                    • 7. Re: Total fields in portal as they are entered
                      RayCologon

                      mike.goss@citta.co.uk wrote:

                      Records | New Record

                      Entered a key, and then started entering data in the portal...

                       

                      Hi Mike,

                       

                      Yes, that's definitely a problem. With the previous TSM example, I was focussing only on updates to reflect changes made to existing portal records, but of course using a separated data file, new rows aren't included in the total until both files can 'see' them, and that does require a commit. That's one down-side of using a separated file structure.

                       

                      If you were using v10 or later, there are some seamless ways to solve the problem using script triggers, however since you're using v9, your options are more limited. One thing you might consider, however, is to provide a custom menu command (with a keyboard shortcut and, if you like, a button on the layout) for adding new portal rows. With users adopting the alternative method for adding portal rows, you can solve the problem cleanly in the background.

                       

                      In case you'd like to explore this, I'm attaching an updated copy of the example in which, rather than pressing tab to get a new portal row, you need to use the New Portal Row command (Command+Option+N on Mac, Ctrl+Alt+N on Windows).

                       

                      Regards,

                      Ray

                      ------------------------------------------------

                      R J Cologon, Ph.D.

                      FileMaker Certified Developer

                      Author, FileMaker Pro 10 Bible

                      NightWing Enterprises, Melbourne, Australia

                      http://www.nightwingenterprises.com

                      ------------------------------------------------

                      • 8. Re: Total fields in portal as they are entered
                        mike.goss@citta.co.uk

                        OK thanks - I'll look at the options.

                        1 of 1 people found this helpful
                        • 9. Re: Total fields in portal as they are entered
                          mike.goss@citta.co.uk

                          Many thanks - I now have a layout working as I need it to.