4 Replies Latest reply on Jan 5, 2009 4:17 PM by johnhorner

    auto enter calculations

    johnhorner

      Title

      auto enter calculations

      Post

      i have a file that contains about a dozen tables.  in one of the tables i have a text field set up to auto enter a calculation that is based upon 2 other fields in the same table which are calculation fields sometimes only referencing fields within the same table and sometimes referencing fields from other tables.  i have it set to "evaluate always" and "replace existing data".  however, this calculation is never evaluated, or at least, it never places either the "then" or the "else" value resulting from the if/then/else auto-enter calculation into the field.  i have very similar fields in other tables that are functioning properly and upon closer inspection i think i have discovered the problem. it seems that entering new data into the referenced fields will only trigger an auto-enter calculation if all of the fields referenced in the auto-enter calculation are indexed.  is there any workaround to obtain the same functionality of the auto-enter calculation (i.e. automatically enter a certain value based upon the values in other, unstored/unindexed fields)?  i am essentially just trying to have an invoice list as "closed" if i enter in a payment amount that equals the invocie total but for various reasons i need the ability to override this.  and, of course, the solution is only useful if it does not require any additional "clicks" as it would only take one extra click to manually enter this information.  any thoughs would be much appreciated.

       

      thanks,

       

      john h.

        • 1. Re: auto enter calculations
          Jens Teich
             Maybe it is an option for you to use version 10 which introduces script triggers. This makes such processes much smarter. You can run any script on field change.

          Jens
          • 2. Re: auto enter calculations
            johnhorner
              

            hi jens,

             

            thanks for the speedy reply.  a couple of things: first, i noticed that i was wrong.  it doesn't seem to matter whether the auto-enter calcualtion references non-stored.  in the field where it is working properly it does reference one such field yet still works whereas the other one doesn't.  second, i think will have to learn a little more about filemaker to take advantage of your suggestion.  i did just download version 10 thinking that maybe it was just a bug that would be resolved (no luck) but now i will have to look into the script triggers you mentioned (i don't even know what that means exactly but it sounds like a good lead).  i am assuming that i can write a script that will activate when the data in a field is modified?  this sounds like it would do the trick!  i'll let you know if i have any success.

             

            thanks,

             

            john h.

            • 3. Re: auto enter calculations
              Jens Teich
                 > I am assuming that i can write a script that will activate when the data in a field is modified?

              That is exactly right.

              Jens

              • 4. Re: auto enter calculations
                johnhorner
                  

                hey jens,

                 

                thanks.... that did the trick.  i wrote a script (essentially the auto-enter calculation form before that was not working) and set up a trigger in the appropriate field.  at first it wasn't working correctly.  it required that i enter the information 2x before the desired result would occur but then it occurred to me that the script was running and referening calculation fields that hadn't yet been calculated (it must have been a millisecond behind in the queue or something).  so i simply added a "commit record" before the main body of my script and that seemd to give the referenced calculation fields a chance to recalculate before being utilized by my script (rather than after the fact).  perhaps that is related to why the auto-enter calculation was not working before... perhaps the referenced calculation fields had not recalculated before the auto-enter looked at them to see if they had been modified.  who knows?  anyway, awesome new feature!!!!!

                 

                thanks so much,

                 

                john h.