6 Replies Latest reply on Sep 18, 2014 9:43 AM by DavidJondreau

    Adding Records in Found Set - Getting find Criteria

    dsr1

      Hi All,

       

      Does anyone know of a native(-ish) method I can use to capture the criteria of the current found set and transfer that data to new records?

       

      My scenario is a found set of a product table. So, for example the found set is:

       

      Manufacturer = "Steel R Us"

      Product Category = "I Beams"

       

      When I add a new record within this found set I want both of these criteria to default into their respective fields.

        • 1. Re: Adding Records in Found Set - Getting find Criteria
          erolst

          Since you don't need a generic method for any fields, but just those two, you could use a button that says “Make new record like this one". Capture those two values into $vars, make a new record and set the two fields.

           

          This would also work independently of the actual method used to arrive at the current found set.

          • 2. Re: Adding Records in Found Set - Getting find Criteria
            jbrown

            Morning.

            Are you doing this find in a script? Are you entering find mode, setting the fields to the certain criteria and then performing the find? If so, you can simply put the criteria values in variables (one each) using the "Set Variable" step and using those variables to set the fields when you create a new record.

             

            If you're not using a script to create a record, you can approach this another way: you still need to use a script to actually do the find. In that script you can set a global variable to each of the criteria:

             

            Set Variable: $$Manufacturer = "Steel R US"

            Set Variable $$Product = "I Beams"

            Then enter find mode

            Set field: Manufacturer = $$Manufacturer

            Set field: Product Category = $$Product

            Perform Find

             

            This gives you your found set.

             

            In the field definitions of those fields, you can do an auto-enter using the respective variables as the Data. This would, when you've set the variables in memory, always fill in new records with those values.

             

            Global variables are session-specific and user specific, so they'd need to be set some way each time a user logs in, but they will stay usable throughout the whole session.

             

            Other:

            Instead of using global variables you could create two fields that are global fields. These fields can be used free of context. That is, you can have a "global fields" table and use those values throughout your whole system regardless of relationship.

             

            Again. these global fields are user specific, and, if your file is hosted, they must be set each time you log in. But instead of the global variables you can use the global fields in the field definition of the Manufacturer and Product Category fields as Auto-enter. Any value in the globals will be placed in these fields upon record creation.

            • 3. Re: Adding Records in Found Set - Getting find Criteria
              dsr1

              The layout is actually a product updating tool.

               

              There are 30+ fields that the user can filter content via Find. The Find Set is then presented in a Header, Body, Footer format displaying those same fields along with a sub set of tools to manipulate each "column" of fields. Think spreadsheet.

               

              Ideally I would like to read the Find Set criteria so I can display it in the header then use it as defaults for new records.

               

              I often display the selection criteria in report headers so that there can be no argument about the report contents.  However, most reports have only a limited criteria set and capturing this data is usually done prior to any Find activation, so I already have it stored in global fields.

               

              This one is a big muttha and uses Find in it's native manner, so ideally I want a Get function to return the Find criteria, but alas.....

              • 5. Re: Adding Records in Found Set - Getting find Criteria
                dsr1

                Thanks Mike,

                 

                That gives me some food for thought.

                 

                Simple, co-operative and compliant is what may lazy butt wants.

                 

                When I said native I was thinking of Tahiti, not New Guinea.

                 

                 

                 

                Peter

                • 6. Re: Adding Records in Found Set - Getting find Criteria
                  DavidJondreau

                  Duplicate Record[]? Import[]?