5 Replies Latest reply on Dec 18, 2013 11:07 AM by philmodjunk

    Need to click on Layout to get calc fields

    JimBessette

      Title

      Need to click on Layout to get calc fields

      Post

           I had a layout that works great.  It has a couple of calc fields, and as soon as I see the record, everything is filled out.  User now asks "can we put that in a portal on the xxx layout".  Well, sure, why not?   So I do. I put it in a tab (as there are other tabs on the same layout).   Problem is that when I go to that tab, the calc fields are not calculated until I click on the layout somewhere (actually, in an area that's not a field, or a 2nd click on the tab.  I've tried all kinds of triggers, but can seem to get anything to essentially emulate a mouse click.  I'm to the point that I actually SPEAK that I'm in the right tab.  I've tried Refresh Window - nothing.   Any ideas?

           Thanks, Jim

        • 1. Re: Need to click on Layout to get calc fields
          philmodjunk

               It would help to know how your calculations are set up. What you describe is typical of a summary field from a related table when you have edited a field that should then change the value in the summary field. Most calculations won't need such an added "nudge" just to get them to update.

               But clicking the layout background commits your record. (Saves it back to the database.)

               There's a script step that does the same thing and it's called: "Commit Records". wink

          • 2. Re: Need to click on Layout to get calc fields
            JimBessette

                 OK, I actually did laugh out loud on that one Phil.  So, the calcs are two fields that are in the portal.  There are two fields, AddedPoints and Subtracted points.  The the calculation of  all the points.   Each of the "Points" records is transaction of added points or subtracted points.   Two calcs take place on those (added and deducted), then the balance uses those to get total points.

                 I did the commit record, and of course, it works.  But I'm wondering why it doesn't work without committing.  I'm just browsing, nothing's changed.  It does actually show correctly for records where I've been before (cached).  

            • 3. Re: Need to click on Layout to get calc fields
              philmodjunk

                   How are you computing the total? Where are you showing that total? On the layout just outside of the portal? or is this a running total inside the portal?

              • 4. Re: Need to click on Layout to get calc fields
                JimBessette

                     Layout is based on table Client -  2 portals on it .  Client Tour - lists the tour the client has been on.  In that portal is the # of points for that tour (taken from the Tour table)     In Tour- I have a summary of points.    Another table, and portal on the layout is Points.  These are records that allow me to either add or subtract points from a person's total.   On the layout itself (based on Client) is where I show the calculation.   The calcs are all done in the ClientTour table.   It gets total points from Tour table, then from Passpoint table it gets the adds and minuses (summary fields), and on the layout (OUTside any portal) I show all that info - like 1st grade math:   points from tours,  next line + points added  next line points subtracted,  next line Total.  

                     None of the points are showing unless I click on the form, or as you mentioned, commit.

                • 5. Re: Need to click on Layout to get calc fields
                  philmodjunk

                       And this is due to the summary fields used. If you set up a sum calculation to get the same total by defining a calculation in the parent table to get a total from the related table, this results will typically update without any extra scripting to make it happen--though there are exceptions to that.