2 Replies Latest reply on Nov 9, 2011 4:02 PM by jayGamel

    Find with the value of another field

    annacaltech

      Title

      Find with the value of another field

      Post

      Hi,

       

      I am trying to create a find feature that can perform find by taken a value from one field and performing the find with that value in another field. 

       

      I have written:

       

      Enter Find Mode[]

      Set Field[searchfield; inputvaluefield]

      Perform Find[]

       

      But I keep getting this error message:

       

      There are no valid criteria in this request. Type a valid request before clicking Find.

       

      What I am doing wrong.

      Thanks for the help!!

      Anna

        • 1. Re: Find with the value of another field
          philmodjunk
            

          When you enter find mode (either by hand or in a script) it's as though you created a new blank field for entering your find criteria. That's keeping your script from working. Capture your data in a variable, then enter find mode and do the find:

           

          Set Variable [$inputvalue, table:inputfield]

          Enter find mode[]

          Set field [table::SearchField, $inputvalue]

          Perform find []

           

          PS. your script will work as you originally wrote it if the input field is a global field.

          • 2. Re: Find with the value of another field
            jayGamel

            This is exactly what I was looking for, only it doesn't work.

            Using FMP11, when I go to the set field calculation, is says the results must be text. I'm looking up one number field in a separate table (don't ask), and trying to find fields that contain that number in the main table. Both are three digit numbers. So I don't get the text requirement.

            When i run the script, 

            Go to Layout [ “Main Link” (ClassLink) ]

            Show All Records

            Set Variable [ $current; Value:Issues::Current Issue Number ]

            Enter Find Mode [ ]

            Set Field [ Classifieds::issueID; $current ]

            Perform Find [ ]

            I get "The provided criteria is not valid. Enter a valid request before proceeding."

            Again, both field are NUMBERS. What's the problem? Do I have to do a numtotext conversion in the variable setup? and back for the find?

             

            the issues table has a list of issues over several years (irregular publishing dates, sequential issue numbers) It determines the correct current issue number. I need to find which classified ad has been assigned the current issue number to generate printed ads for editorial. I think i've gotten the issues table to update the current issue nubmer every time it opens, but I'm damned if I can get the ad table to be able to refrerence it. I'm pretty sure the tables are related properly. It's just that the find operation does not like the format of the set field process.

            Any help appreciated.