8 Replies Latest reply on Oct 11, 2016 8:02 AM by philmodjunk

    How come the calucated value for the field was not executed?

    liyangao

      I have one calcuated value for a new field and somehow the field was still empty after I defined it in the management database window. I wondered why.

       

      I have imported a date field (called DateImp) from file and I want to define a new date (NewDate) field as auto-enter calculation replaces existing value with always evaluation to keep the existing value and to get the current date for all newly generated records. The calculation looks like the following:

      If (IsEmpty(DateImp); Get (CurrentDate); DateImp). The option of Do not evalute if all empty was unchecked.

       

      How come the new date field was still empty after the mangement database window is closed? It seems that it was not executed at all. Do I have to initilize the field or what?

       

      Would you please help me to check what went wrong?

       

      Thanks a lot,

      Liyan

        • 1. Re: How come the calucated value for the field was not executed?
          cortical

          perhaps try:

           

          noted:  the aec_calc  is disabled for ' do not replace existing value'

           

          is it a commit issue? Is it an indexing issue ( if so close db and reopen) ? Is there a  indexing definition on the aec involved?

           

           

          for non - update of displayed values, you can try commit and/or refresh +/-flush

           

          if it is a field defined in the table defined by the layout, commit should work, or additionally a refresh ( no flush)

           

          If it is a calc that references a releated table, then you may need to resort to incorporatong a refresh/flush

           

          Be aware theat refresh/flush , flushes ALL cached data, and not just that pertinant to the involved fields

          • 2. Re: How come the calucated value for the field was not executed?
            BruceHerbach

            Hi,

             

            Because it is an autoenter,  it will only update under the following conditions.

             

            1)  When a new record is created

            2) You enter date into the dateimp field.

             

            Just entering the record as you would when closing Manage Database won't trigger an update to the field.  At time this can be a very useful feature.  If you need it to update any time the field is seen, make it a Calculation.  In this case any time the field appears on the screen it will update.

             

            HTH

            • 3. Re: How come the calucated value for the field was not executed?
              markmeer

              I have a similar (newbie) issue....

               

              1. I created a table with two fields: first_name, last_name.

              2. I then created and populated a bunch of records.

              3. In the layout, I want a title with the full name so:

              3(a). I create a new field (full_name) that is a calculation (= first_name & " " & last_name).

              3(b). I insert a "Merge Field" text item in the layout and point to the calculation field I just created.

               

              Here's the problem: the calculation does not get executed until records are edited or created.

              So while all new records show the title, all records created prior to the creation of the calculation field do not (unless I edit each one manually).

               

              Is there a way around this?  Can I create a new calculation field and have it automatically execute across all existing records?

              • 4. Re: How come the calucated value for the field was not executed?
                beverly

                calculation or auto-enter calculation?

                what is the storage on the new field?

                 

                If auto-enter only new records will get the value. You can find all the records which are empty in that field and Replace Field Contents with the same calculation use in the Auto-enter. Et Voila! your field is populated for the older records.

                 

                Be careful using the Replace (under the Records menu in Browse mode)! If you are in the wrong field, it can destroy data.

                 

                beverly

                1 of 1 people found this helpful
                • 5. Re: How come the calucated value for the field was not executed?
                  markmeer

                  Thanks beverly! This solves it! Much appreciated!

                  • 6. Re: How come the calucated value for the field was not executed?
                    philmodjunk

                    Here's a trick that can be used to make a new or modified auto-entered calculation to update all records in the table:

                     

                    Change the field type to Calculation. When you do, your auto-enter calculation automatically appears in the calculation editor as the calculation expression. Click Ok to exit Manage database. This will then update the value in this field in all records in the table. Then, return to manage database and set the field type back to auto-enter calculation. The calculated expression automatically pops back as the auto-entered calculation and now you have an auto-entered calculation with all records updated. This can be a few steps simpler than doing a replace field contents operation to update the existing records.

                    1 of 1 people found this helpful
                    • 7. Re: How come the calucated value for the field was not executed?
                      beverly

                      yes, this may also work (sometimes, for me at least). While there is a schema change to make plain into auto-enter, I don't like the plain-into-calc-into-autoEnter schema route. Probably personal preference, or it failed a time or two for me.

                      • 8. Re: How come the calucated value for the field was not executed?
                        philmodjunk

                        It's always worked for me--so I'm a bit puzzled by that "sometimes".