3 Replies Latest reply on Apr 24, 2009 9:18 AM by joshonefive

    what criteria/parameter to use to script "peform find" on a checkbox field?

    joshonefive

      Title

      what criteria/parameter to use to script "peform find" on a checkbox field?

      Post

      Hey guys,

       

      Wondering how to setup a script to find all records that have a checkbox in a certain field, and then export those records. 

       

      I have the export part of the script down, just not sure how to script the perform find of records with a checkbox field checked. 

       

      I am using "ready for export" = 1, which is not working. I figured "1" would represent a check in the checkbox, and "0" would represent no check. 

       

      Any help is much appreciated, thanks!

       

      josh 

        • 1. Re: what criteria/parameter to use to script "peform find" on a checkbox field?
          philmodjunk
             Check boxes enter a selected value of your field's value list separated by a carriage returns if one or more check boxes have already been checked. Put a copy of your check box field next to the original and remove the check box formatting. Now click on your check box and see what appears in the unformatted copy. What you see in the unformatted field is what your script will need to set as search criteria in order to find the records.
          • 2. Re: what criteria/parameter to use to script "peform find" on a checkbox field?
            davidhead
              

            joshonefive wrote:

            ...a script to find all records that have a checkbox in a certain field, and then export those records. 

             

            I am using "ready for export" = 1, which is not working. I figured "1" would represent a check in the checkbox, and "0" would represent no check. 


            If you have a field with a single checkbox, then unchecking that checkbox will not put a 0 in the field - it will simply become empty. 
            You can do your search in one script step:

                        Perform Find [ Specified Find Requests: Find Records; Criteria: Table::ReadyForExport: “1” ] [ Restore ]

            Or a few steps that construct the Find request:

                        Enter Find Mode [  ] 

                        Set Field [ Table:: ReadyForExport; 1 ] 

                        Perform Find [  ] 

            While the second method takes three steps instead of one, many developers prefer it for it's clarity in what search is being performed. 
            Then you export the found set. 

             


            • 3. Re: what criteria/parameter to use to script "peform find" on a checkbox field?
              joshonefive
                

              Thanks guys,

               

              I used: Perform Find [ Specified Find Requests: Find Records; Criteria: Table::ReadyForExport: “ready” ] [ Restore ]

               

              It works great. I had to change "1" to "ready" since that is the actual text displayed next to my checkbox. 

               

              So checked = "ready" or if checked, then "ready".

               

              Thanks I really appreciate the help guys, it has better helped me understand filemaker scripts. 

               

              Josh