6 Replies Latest reply on May 21, 2010 8:09 AM by TSADesign

    Updating A Global Field

    TSADesign

      Title

      Updating A Global Field

      Post

      I'm sure this is a pretty basic question, but it's got me buffaloed ;)

       

      I have a Summary Field that  will update on a weekly basis in Table A. I want to update a field in another table (Table B), but I don't want it to update automatically. I want to be able to trigger the update.

       

      The issue i'm having is that in order to update the field in the Table B, I have to use a Global Field in Table A. Since my field in Table A is a Summary Field I cannot store is as a Global Field, so I created a "Copy" field that indicates its content is to come from the Summary Field (Field Copy = Field). The Copy field is then set up as a Global field.

       

      The issue I'm having is that when I import new data into the report the original Summary Field updates properly, but the Global Field remains blank unless I manually go and change it from a Global Field to a Unsorted field, then manually change it back. Once I do this step the correct data is updated in the Global Field and I can push the data into Table B. There are 10 different fields that have a similar setup, so going into each manually is too time consuming.

       

      I cannot use a Portal because I need to produce a new record inTable B so I can then report back on trends of data being reflected in Table A.

       

      I'm guessing this is a fairly simple request (at least I'm hoping it is), but I appreciate your time in responding.

       

      Thank you,

       

        • 1. Re: Updating A Global Field
          aammondd

          Id suggest that you make your global field in its own table and have it populate on record load script trigger.

           

          Then to ensure that it remains correct have it populate again just  before you "button" to create the new record in table B

           

          the only issue ive had with this is remembering to create 1 new record of the table that houses my global fields if you do that it should work fine.

           

          I like to think of Global fields as temp fields and hardly ever use them in the parent table as they can "hover" above everything

           

          • 2. Re: Updating A Global Field
            philmodjunk

            It's easier to understand and analyze a problem like this if you use actual names and give an example of what you are trying to do.

             

            If you are importing records into a table first, is this in a script?

            If so, a Series of set field steps could be added to move a copy of this data to wherever you need it once the import has taken place.

            • 3. Re: Updating A Global Field
              TSADesign

              Here are examples of the script I'm trying to run (i'm new to scripting, so these are pretty basic).

               

              I am updating a Table called Customer Database then running this script on push of a button:

               

              Go to Layout ["Global Field Table" (Global Field Table)]

              New Record/Request

              Set Field [Global Field Table::Number of Accounts over 60 Days; Customer Database::Count of 60 Day Accounts]

              Go to Layout ["Running Dashboard" (Running Dashboard)]

              New Record/Request

              Insert Calculated Result [Select; Running Dashboard::Number of Accounts over 60 days; Global Field Table::Number of Accounts over 60 Days]

               

              Thanks.

              • 4. Re: Updating A Global Field
                aammondd

                Not sure why you insert calculated result here instead of set field.

                 

                I also notice that you are not setting your global field before leaving the record.

                 

                I would ensure that you have a global table record on database open script you usually dont need more than one to pass values to the global field and you dont need to go to the global table layout in order to do so.

                 

                generally I hide my global table layouts and only access them from layout mode.

                 

                Once you go to that layout you are likely losing the number so you cant set the global field to it.

                 

                As long as there is 1 record in the global table you dont need to create a new one there as global storage only keeps 1 value anyway

                 

                 

                • 5. Re: Updating A Global Field
                  hschlossberg

                   


                  TSADesign wrote:

                  I am updating a Table called Customer Database then running this script on push of a button:

                   

                  Go to Layout ["Global Field Table" (Global Field Table)]

                  New Record/Request

                  Set Field [Global Field Table::Number of Accounts over 60 Days; Customer Database::Count of 60 Day Accounts]

                  Go to Layout ["Running Dashboard" (Running Dashboard)]

                  New Record/Request

                  Insert Calculated Result [Select; Running Dashboard::Number of Accounts over 60 days; Global Field Table::Number of Accounts over 60 Days]


                  It sounds like you are essentially trying to update your dashboard table based on updates to your Customer table.  It's not clear to me why you are adding a new record in your Global Field table since you really don't need any records in there at all for global fields.

                   

                  I would rewrite your script (assuming you are on the customer layout) without globals, as:

                  Set Variable [ $ct; Customer Database::Count of 60 Day Accounts ]

                  Go to Layout ["Running Dashboard" (Running Dashboard)]

                  New Record/Request  // this step isn't needed if your Dashboard table is a single-record table for display

                  Set Field [ Running Dashboard::Number of Accounts over 60 days; $ct ]

                   


                  • 6. Re: Updating A Global Field
                    TSADesign

                    Thank you for taking the time to write out the script. It worked perfectly.

                     

                    Thanks again,