4 Replies Latest reply on Mar 26, 2009 7:49 AM by Jerten81

    Constrain Found Set Without Using Right Click Menu

    Jerten81

      Title

      Constrain Found Set Without Using Right Click Menu

      Post

      I have created a database that uses the Filemaker 10 dynamic reporting feature (being able to view subsummary reports in browse mode).  After a report is generated and is sorted by subsummary fields I want the user to be able to further constrain the found set by the subsummary field.  This is easy enough to do with the right click menu but I want the user to be able to further constrain WITHOUT using the right click feature as it won't be available once the database is web published.  The constrain function does not allow for any kind of calculation that I know of.  Any ideas?

       

      Thanks.

        • 1. Re: Constrain Found Set Without Using Right Click Menu
          Orlando
            

          Hi Jerten81 and welcome to the forum,

           

          You can also use scripts to constrain a found set, but you will need a button on the layout, and you coudl make the summary field the button, that will perform the following script, I have used the name TABLE::SumField for the summary field the user will be constraining the report by:

           

          #
          Set Variable [ $Value ; TABLE::SumField ] 
          Enter Find Mode [] // Deselect the Pause option
          Set Field [ TABLE::SumField ; $Value ] 
          Constrain Found Set []
          Sort [ Restore ; No dialog ] // This will be the sort order for your Sub Summary layout
          #

           

          You then need to assign this script to a button, you create your button on the layout via the Button tool, for an actual button, or selecting an object and going 'Format > Button Setup...', to make the summary field the button, and then when the Button Setup dialog appears you need to specify 'Perform Script' from the list on the left and then hit 'Specify' under Options and choose your script from the list.

           

          I hope this makes sense, if you have any questions about any part of the script then just ask.




          • 2. Re: Constrain Found Set Without Using Right Click Menu
            Orlando
              

            Also if you wanted to use multiple summary field to trigger the constraining of the found set you can modify the script to be a bit more complex:

             

            First the script will look like this:

             

            #
            Set Variable [ $Value ; Value = GetField ( Get ( ScriptParameter ) ) ] 
            Enter Find Mode [ ] 
            Set Field By Name [ Get ( ScriptParameter ) ; $Value ] 
            Constrain Found Set [  ] 
            Sort [ Restore ; No dialog ] // This will be the sort order for your Sub Summary layout

             

            What you are ding with this version is passing the field name into the script and generating the find as the script is run. So for this to work you also need to modify your button.

             

            So following the previous instructions for setting up a button attached to your field, where you specify the actual script there is an 'Optional script parameter' under the list of scripts, what you need to add in here is the name of the field the button is attached to in quotes, so for my example I need to input "TABLE::FieldName". 

             

            You can also press 'Edit' select your field and then place quotes around it.

             

            I have just tested this in FileMaker Pro 10, but not IWP but all script steps used are compatable with Web Publishing so I doubt there will be any issue. 

             

            I hope this helps 




            • 3. Re: Constrain Found Set Without Using Right Click Menu
              comment_1
                 I think Jerten81 means "break fields", when he says "subsummary fields". Summary fields cannot be searched.
              • 4. Re: Constrain Found Set Without Using Right Click Menu
                Jerten81
                  

                Hi Orlando,

                 

                Thanks for the help.  Your solution works great!