3 Replies Latest reply on Oct 27, 2016 8:34 PM by BruceRobertson

    Help writing a script with a radio button

    JanCarpenter

      Title

      Help writing a script with a radio button

      Post

      Ok - warning - I'm VERY new to Filemaker.

      I have a very simple database with a radio button field that contains a button for yes or no.

      I want to write a script that will find all those records that have the button "yes" chosen (i.e., exclude those that have "no" checked).

      I can't figure out what logic would be correct to get that result.  I know how to write a script with a "find" set of commands (i wrote one to get anyone with last name "smith" and it worked - obviously using a different field from the radio button one), but can't seem to get it to work with a radio button.

      Can anyone help?

      Thanks!

      Jan

        • 1. Re: Help writing a script with a radio button
          philmodjunk

          Finding all records where "yes" is selected may not be the same as excluding all those that have "no" checked. If the field is blank, finding for "yes" won't find them, but omitting "no" will.

          Enter Find Mode[]
          Set Field [YourTable::yourRadiobuttonfield ; "Yes"]
          Set error capture [on]
          Perform Find[]

          Will find all records where YourTable::yourRadiobuttonfield stores "yes" as the only value.

          Enter Find Mode[]
          Set Field [YourTable::yourRadiobuttonfield ; "No"]
          Omit Record
          Set error capture [on]
          Perform Find[]

          Will omit all records where the radio button field as "no" selected.

          • 2. Re: Help writing a script with a radio button
            basilisk2

            I have exactly the same question as Jan had. I tried your suggestion but am unable to enter the Script information in some steps. 

             

            The Script Debugger stops at the Enter Find Mode step.

            It then ignores the Set Field step (or at least it doesn't 'click' on the Yes Radio Button as if the Radio Button does not store the "Yes" value as "Yes" but as data entry is set to "Validated by Value List" that is strange.

            Then it jumps right through to the Perform Find step and posts an error message [401] No records match the request.

             

            Where can I look for a possible issue?

             

            TIA

            • 3. Re: Help writing a script with a radio button
              BruceRobertson

              The first thing to do is to provide an accurate copy of your script.

              You could do this by printing the script to PDF; and attaching the PDF; or taking a screenshot and attaching that.

              Or consider attaching a copy of your file (can be a clone without date)