3 Replies Latest reply on Nov 27, 2015 3:18 AM by tays01s

    Updating 'evaluations'


      I have a series of 53 records for which 9 fields are evaluated. This takes a couple of seconds so is fine if you want the records updated because there's been a change in fields they draw data from ('input data'), but not if there's been no change.


      Because these records are displayed on a particular tab, if there's been a change in 'input data' I'd trigger an evaluation update on entering that tab. But what 'priniciples' should I look to, to monitor input fields for data changes?

        • 1. Re: Updating 'evaluations'

          Every time you evaluate, set a timestamp in a table with just one record - table System, field LastTS.


          Upon deciding whether to evaluate or not, do an ExecuteSQL with max(ModifyTimestamp) from the 9 records you are monitoring, compare that with the LastTS and decide based on this comparison.

          • 2. Re: Updating 'evaluations'

            every record keeps track of the number of times it has been modified. If you store the modification count you can compare it with get(recordModificationcount). If they are the same, do nothing, else update . If your data comes from several records you can total the modification counts, it comes to the same thing. If the current mod count is greater than your stored mod count, something has changed and you should update.

            • 3. Re: Updating 'evaluations'

              I can see that both suggestions may work. Thanks.


              Moving from principle to detail: I have tables related in the order:

              A < B < C < D &

              If any of these values change, the evaluation calcs need updating. Taking the "get(recordModificationcount)" example, I have put an unstored field calculating this on all of A-D tables. The fields that need evaluating are related:

              C2 < E.

              The snag is that when I sum 'mod counts' changes to A, B, C fields are updated but for D only the first record. I assume I somehow need to sum all records from D related to C?