5 Replies Latest reply on Mar 5, 2012 12:23 PM by datarunner

    Script Find/Set Field in Report w/SubSummary

    datarunner

      I have a report that summarizes hours logged by a "WeekBegin" date field. The report does exactly what is needed, however I need to give users the ability to get the same report for specific date ranges they enter. The script I have works correctly when it sets the correct field value for the find called in the script (I have tested in an alternate DB when not using a subsummary field).

       

      My issue, is that the Set Field function is setting the field in the subsummary part - and it will not perform the find. If I have the field repeated in the body of the same report, I can manually do a find and it works. I tried swapping out the merge field with the typical field and this did not correct the issue either. I've tested doing the find manually on the subsummary field unsuccessfully as well so I'm assuming now finds just cannot be performed within a subsummary part.

       

      Is there a way in the script to have it Set Field on a field in the body of the report instead of going to the field in the subsummary? If not, does anyone have a suggestion of a good way around this?

       

      Thanks in advance for any help!

       

      Leah

        • 1. Re: Script Find/Set Field in Report w/SubSummary
          LyndsayHowarth

          You could try taking out all but the body fields from the Tab order...

          You could name the object (using the Position tab in Inspector) and gotoobject() in your script

          The field in the subsummary does not have to exist... only a merge field. The real field should exist in the body.

          In Behaviour are you able to go to the field in both Browse and Find modes?

           

          - Lyndsay

          • 2. Re: Script Find/Set Field in Report w/SubSummary
            comment

            datarunner wrote:

             

            My issue, is that the Set Field function is setting the field in the subsummary part

             

            Your issue is not clear to me. Set Field [] works at the data level: it sets the field regadless of where - or even if -  it is on the layout.

             

            datarunner wrote:

             

            I've tested doing the find manually on the subsummary field unsuccessfully as well so I'm assuming now finds just cannot be performed within a subsummary part.

             

            I don't know of anything that would support such assumption.

            • 3. Re: Script Find/Set Field in Report w/SubSummary
              timwhisenant

              Hi datarunner,

               

              I don’t think the problem is with the location of the field on the layout, i.e. what part. But rather are you trying to set a summary field and perform the find. “You can’t enter search criteria in …. summary fields.” From filemaker help.

               

               

               

              A regular stored indexed field will be the best when trying to find records.

               

               

               

              HTH

               

              Tim

              • 4. Re: Script Find/Set Field in Report w/SubSummary
                keywords

                A very basic question Leah ... is your script putting the table in Find mode before performing the Set Field step?

                • 5. Re: Script Find/Set Field in Report w/SubSummary
                  datarunner

                  I apologize for the delay!  I got pulled into a different project and haven't had time to get back here. 

                   

                  Thanks for all of your input, I actually discovered that the issue was not with my script, but because I had not made the startdate, enddate fields I was using for the input fields for the range determination as "Global" fields.  Now that I have made this adjustment it is working properly.

                   

                  Thank you

                  Leah