3 Replies Latest reply on Sep 25, 2013 8:48 AM by philmodjunk

    GetSummaryField

    janslort

      Title

      GetSummaryField

      Post

           Hello all:

           A month ago. PhilModJunk (who often answers our questions on this forum) suggested I could Set Field with the sub-summary totals of a summary field.  So I wrote a script to "Get" the summary results from a disbursements file.sorted by a break field called account ID.  A print screen of the list of 16 or so totals by the account number is attached.  Try as I might, I can't make the figures from the list "post" to another file.  I'm familiar with set field script steps, but I cant figure out how to do this one.  The main puzzler for me is how do I identify the sub-summary I'm aiming at when it's tied only to the break field.  Any one want to try a setField script step?

            

           Jan Slort

      disbursemt.png

        • 1. Re: GetSummaryField
          philmodjunk

               You'll need to describe the design of your database and exactly what you want to do in more detail. In many cases, such a script is not needed.

               Is each row in the screen shot from a sub summary layout part?

          • 2. Re: GetSummaryField
            janslort

                 Phil:

                 Thanks for your reply.  The details of my design and its purpose are as follows:

                 I have a checking account file in which I record all the checks that are written, I added invoices that must be paid in the future, and thanks to your help, can create a check when I want to pay them.  Each item is designated with an accounting field (accounting ID) and totaled by creating a sort by that field in a sub-summary part (screen shot enclosed).  Great.  Now I want to "Get" that amount and "post" it to the General Ledger, create a "journal entry" and in general be able to use it the same way I can manipulate any other piece of data.  I just can't get a hold on it.

            • 3. Re: GetSummaryField
              philmodjunk

                   It's possible to loop through your records and use GetSummary to put those values in a variable, switch over to a layout based on the general ledger table, create a new record and use set field to copy the data form the variable to a field in the new record. But you'll have to carefully design that looping part of your script so that it only does this once for each group of records.

                   If there is any chance that you have a table with just one record for each of the accounts listed in your example, you can use that table with a relationship to the table that contains the data shown and then you can set up a script to loop through the records and Set Variable with the Sum Function can put the same sub total into the variable. The trick to doing this is to set up a relationship that only matches to the desired data which means matching by more than just the AccountID. You'd probably need an additional match field pair or two for matching either by a date range or a "paid"/"unpaid" status value on the indivdiual transaction record.