1 Reply Latest reply on Jul 9, 2014 8:50 AM by philmodjunk

    Find problems

    fmpro_novice

      Title

      Find problems

      Post

           What I want to do should be simple, but I can't get it to work. I have a number field called MaxHandicap. The user types in a number in this field. My records have a number field called Handicap. All I want to do is find all records where the Handicap is greater than the MaxHandicap. Attached is a script that I'm trying to make work, but it constantly tells me No Records Match...

           If someone can look at this I would appreciate it.

           Thank you!

      screenshot.jpg

        • 1. Re: Find problems
          philmodjunk

               Your script attempts to specify find criteria three times when it only needs to do so once and the criterion shown in your screen shot won't work.

               You should remove the stored find request as stored find requests cannot refer to the contents of a field like this and your set field step, it it worked, would over write this stored criteria anyway.

               The set field step will correctly set up search criteria only if MaxHandicap has global storage specified. But if it does not have global storage specified, the set field step will not work. (Enter find mode on a layout where you have at least one global and one non global field--with data in each. Note how the nonglobal field appears empty in find mode, but the global field still displays the data entered into it...)

               You then need to remove the stored find request in the Perform Find step as it also probably overwrites the criteria specified by the set field step.

               You might find this link to a thread of scripted find examples useful: Scripted Find Examples

               Note: if you don't want to make MaxHandicap a global field, you can copy it's value to a variable before entering find mode and then user set field to copy this data from the variable into the Handicap field in order to set up your find criterion.