3 Replies Latest reply on Jun 19, 2017 7:56 AM by philmodjunk

    Update records from subsummary

    ndveitch

      Hi there,

       

      How do I update records in a Subsummary report? I have a subsummary report with no body and the users need to update the records if they change the value in the drop down field in the subsummary. I have a GTRR script that updates the records, but I was wondering if there is a way to do it without scripting.

       

      The script is fairly basic,

       

      Set Variable [ $fieldName ; Value: Get ( ActiveFieldName ) ]

      Set Variable [ $fieldTable ; Value: Get ( ActiveFieldTableName ) ]

      Set Variable [ $fieldContents ; Value: Get ( ActiveFieldContents ) ]

      Go to Related Record [ Show only related records ; From table: “Work_in_progress” ; Using layout: “All Fields WIP” (Work_in_progress) ; New window ]

      Go to Record/Request/Page [ First ]

      Loop

        Set Field By Name [ $fieldTable & "::" & $fieldName ; $fieldContents ]

        Go to Record/Request/Page [ Next ; Exit after last ]

      End Loop

      Close Window [ Current Window ]

       

      I have had to replace the GTRR with a find request as I am updating records in the same table and the GTRR kept going to all the records, not the one in the subsummary report. But other than that the script is working fine, I was just wondering if maybe there was a way of placing a field from another TO on the subsummary which might be able to update all the records at once.

        • 1. Re: Update records from subsummary
          SteveMartino

          It's hard to understand what exactly you are trying to accomplish.  The way I read it, if you have a subsummary report, no body,  each line is a group of records, summarized.

          So you then want to take the value (total?) of those records, go to the related records, and put the one value into all the records?

          I guess you could use Replace Field Contents, but it seems to me you are destroying (changing) all the initial data.

          • 2. Re: Update records from subsummary
            ndveitch

            In the subsummary view there are two fields, Category and Assigned to. The user has to change the category and who the tasks is assigned to. Once the assigned user has done what they need to do for that task, they would go back to the subsummary view and assign it to the next person, or change the category if need be. Each task can have any number of records attached to it, and all the records will need to be updated for that task (subsummary group).

            • 3. Re: Update records from subsummary
              philmodjunk

              It would be simpler to link the entire group of records to a single record in a join table such that assigning the group of records to a different person, changing status, changing category for the group, involves updating that single record rather than looping through individual records to make the same change to each. Whether you loop or use replace field contents, it not only takes more time to do, you might encounter record locking issues if it's possible that other users might be editing the same records at the same time.