3 Replies Latest reply on Jun 20, 2014 9:57 AM by philmodjunk

    Scripted find of multiple records

    Matty_1

      Title

      Scripted find of multiple records

      Post

           I'm looking to expand my initial search with a specific set of record IDs through a script.  What I'm currently doing is creating a list of newly created records in a global variable but from my research it seems like you can't list out a specific set of IDs in one field using something along the lines of ";" to separate each number.

           At the end of the day I would love it I could search out a date range (fully functional) and then add record IDs, 3000, 3004, 3005 and 3008 into the mix until the on going history variable is cleared.

           Only other solution I can think of involves a sack load of variables and a loop, seems way too inefficient for nothing.

        • 1. Re: Scripted find of multiple records
          philmodjunk

               It's not completely clear to me from your post, exactly what you are trying to do. Are you trying to find all records in a given date range and then narrow that set of records down to only those in a specific list of ID's?

               That can be done, both with a scripted find or with a relationship that matches by a pair of dates and a list of ID numbers--provided the list of ID numbers are separated by return characters instead of commas.

               For a scripted find example, check out the looping scripts near the end of this thread: Scripted Find Examples

               To use a relationship, define two global date fields: gStartDate, gEndDate and a global text field: gIDList. If you set up this relationship:

               Table1::gStartDate < YourTable::Date AND
               Table1::gEndDate > YourTable::Date AND
               Table1::gIDList = YourTable::ID

               A portal to YourTable on the Table1 layout will list all records in the date range that match one of the listed IDs. Go to Related records from Table 1 can also be used to pull up the same set of records in a found set.

          • 2. Re: Scripted find of multiple records
            Matty_1

                 No, I'm sorry I didn't make myself clear.  I'm looking to find a date range and then EXPAND my search by adding a list of unique record IDs stored within a variable.

                 The spoken find request would be:  Find all records between July 1st and July 5th 2014 and then please add records with the following IDs 3000, 3004, 3005 and 3210.

                 The expand portion can be infinite.  Based on the user clearing the variable.  Each time a new record is created it is stored in the variable to keep track of the "new record history" and the user has the option to clear it out when he no longer needs to see the new records as part of his search.

            • 3. Re: Scripted find of multiple records
              philmodjunk

                   There is a scripted find example in the thread that I recommended that can do this. The script can either generate multiple find requests or it can perform multiple finds using the extend found set [] script step to add the records with the IDs listed in the variable.