3 Replies Latest reply on Nov 14, 2012 8:34 AM by philmodjunk

    set the value of a global field from another global field

    Kaps_1

      Title

      set the value of a global field from another global field

      Post

           I have two global variables "main::start_of_reporting_period" (i.e in a table called main) and "this month::start_of_reporting_period" (i.e in a table called this month). The two tables are related via a cartesian product:-

            

           main id X this_month

            

           I would like :-

           this month::start_of_reporting_period = main::start_of_reporting_period

           so any changes in main::start_of_reporting_period are reflected in this month::start_of_reporting_period. However I cant seem to make the relationship update. thanks

            

           Kaps

            

        • 1. Re: set the value of a global field from another global field
          Sorbsbuster

               If they are both global fields (not variables) you don't need any relationship, as they are 'global' all records will match to all records.  You can make this month::start_of_reporting_period a calculation, with a global storage, where it is exactly as you say:

               this month::start_of_reporting_period = main::start_of_reporting_period

               Although as they are global and equal, why not just refer to the one field?

               It could be useful to show both values on the layout that has the problem, and see if the values update as you expect.  It may be that the values update perfectly, but some calculation or relationship downstream is what is failing.

          • 2. Re: set the value of a global field from another global field
            Kaps_1

                 Thanks. I did actually try the straightforward approach that you described but could not get it to work. I cant have single field as the  this month::start_of_reporting_period will be used to sum the values of related records in another table. Then there will be "next month::start_of_reporting_period" in a seperate table which will feed of from the value of this month.

                 any thoughts ?

                  

            • 3. Re: set the value of a global field from another global field
              philmodjunk

                   That still doesn't indicate that you need two fields--unless both are needed for relationships to different tables.

                   Are you sure that the fields are both set up with global storage?

                   You can also replace one global field with an unstored calculation field (NOT global) that references the other global field. Then the two fields will always show the same data--but this should not be necessary unless, both are needed as match fields in different relationships from different tables.