3 Replies Latest reply on Sep 12, 2016 10:18 AM by hockman11

    Find

    hockman11

      How do I create a script to find student records by county?  I have students in 20 counties but I only want to see all students in 4 of the 20 counties.  I want the user to be able to choose want counties they want to see.  I have that list in a single field (checkbox).  Thank you for the help.

        • 1. Re: Find
          mikebeargie

          Set Variable [ $counties ; List( student::UserSelectionCheckbox ) ]

          If [ ValueCount($counties) > 0]

               Enter Find Mode [ no pause ]

               Loop

                    Set Variable [ $i ; $i + 1 ]

                    Set Field [ student::county ; GetValue( $counties ; $i ) ]

                    Exit Loop If [ $i = ValueCount ( $counties ) ]

                    New Record/Request

               End Loop

               Perform Find

          Else

                Show Custom Dialog [ "Error - you must check a county to perform a find" ]

          End If

          • 2. Re: Find
            philmodjunk

            Mike's method works just fine. You can also set up a relationship that matches your check box field to the records and then Go To Related Records could also be used.

             

            Another observation, if your check box is a global field, you can simplify Mike's example by not using a variable. Just refer to the global field instead of the variable, but only if you've specified global storage for that field.

            • 3. Re: Find
              hockman11

              Mike, you are a life saver.  I appreciate your help.