1 Reply Latest reply on Dec 4, 2013 9:41 AM by philmodjunk

    Constrain Found Set with Variable



      Constrain Found Set with Variable


           I feel silly for having to post this because it must be something obvious I am doing wrong, but I cannot get Constrain Found Set to work for me.  I have a simple table of records containing PDF files in container fields, a text field describing what type of file it is, and a number ID field linking them to the client they belong with on another table.  I have a list-view layout for displaying them, and I am simply building a drop-down filter to choose which file types to show.  It is a value list containing each file type that triggers a script when it is changed passing in a parameter of itself (set to $Type variable at the beginning of the script), which simply shows all records, then does a find on the desired Client ID, then should do a constrain found set on the File Type field based on the $Type variable.  Every time I do this it returns 0 found records, even when I am clearly staring at records that exist. If I do a manual Constrain Found Set with the type I want it finds them perfectly, and when I physically write out a specific type in the Constrain script step it finds those records just fine, but when I try to use either $Type or Get ( ScriptParameter ) or even just the field itself, it always returns 0 found records.  Thank you for the help on what I am sure must be an obvious mistake!

        • 1. Re: Constrain Found Set with Variable

               I wouldn't bother with a constrain found set for this.

               No need to show all records either.

               Just set your script up to specify all the find criteria in the appropriate fields and then perform the find.

               See this thread for examples of scripted finds: Scripted Find Examples

               But if you did want to script such a constrain found set to filter down an existing found set, you could script it like this:

               Enter Find mode [] ----> clear the pause check box
               Set Field [YourTable::FileTypeFieldHere ; $Type ]
               Set Error Capture [on]
               Perform Find []