1 Reply Latest reply on Sep 25, 2009 9:30 AM by philmodjunk

    find using search terms from a text field

    brownriver

      Title

      find using search terms from a text field

      Post

      FM10; WindowsXP; FM beginner.

       

      I have two text fields, "PRnumber" and "PRnumberRange".

      PRNumber is unique to the record, and PRNumberRange is a list of (other) PRNumbers, separated by carriage return. There may or may not be a record for each of the PRNumbers listed in the PRNumberRange field. I want to have a find button that treats the contents of PRNumberRange as individual search terms logically connected by "or", and searches all of my records' PRNumber fields for them. All records that have a PRNumber that appears in the set of numbers in PRNumberRange should be found. I've been trying to do this with a perform find script, but can't for the life of my figure out how to make FM use the contents of one field to look at another. Any ideas? Thanks!

       

       

       

        • 1. Re: find using search terms from a text field
          philmodjunk
            

          "...but can't for the life of my figure out how to make FM use the contents of one field to look at another. Any ideas?"

          You can do this by using Set Variable to capture the contents of the field before entering find mode or you can use set field to copy the field's data into a global field before you enter find mode. Either way you can then use the data to build a find request or,  in your case, series of find requests.

           

          Since you've already got a list of values separated by carriage returns, there's another option that might be even simpler.

           

          Create a selfjoin relationship.

           

          TableName :: PRnumberRange = TableName 2 :: PRnumber

           

          Now you can use

           

          Go To Related Record [Show Only Related Records; From Table: "TableName 2"; Using layout: <Current Layout>]

           

          To pull up a found set of all records listed in PRnumberRange on the current layout. Note that if there are no matching records, the <Current Layout> option results in an empty found set.

           

          GTRR is a very complex tool with numerous undocumented issues. The above example, should be safe. If you want to use this tool in other situtation or with other parameters, please read: The Complete Go To Related Record