8 Replies Latest reply on Jun 21, 2014 5:22 PM by Stephen Huston

    Three Level Find Request Script

    JFWX5

      Hi,

       

       

      I have the following two level scripted find:

       

       

      Enter Find Mode

       

      Set Field "Client Name" ;"Smith"

       

      New Record / Request

       

      Set Field "Record Type"; "Claim Form"

       

      Perform Find

       

       

      It works and finds all "claim forms" with the client name "Smith".

       

       

      How would I add a third level to this script: Claim Paid = "Yes"

       

       

      Thank you,

       

       

      John

       


       


       


        • 1. Re: Three Level Find Request Script
          ChadAdams

          Hi John,

           

          If I understand you correctly, the following script should do what you want.

           

          Enter Find Mode

          Set Field "Client Name" ;"Smith"

          Set Field "Record Type"; "Claim Form"

          Set Field "Claim Paid"; "Yes"

          Perform Find

           

          Chad

          1 of 1 people found this helpful
          • 2. Re: Three Level Find Request Script
            erolst

            JFWX5 wrote:

            It works and finds all "claim forms" with the client name "Smith".

             

            Actually, this will find all records where the type is “claim form“ or the client name is “Smith”, or both.

            • 3. Re: Three Level Find Request Script
              Stephen Huston

              There is a distinction between "And" and "Or" search requests.

               

              When you put different attributes into separate requests, you get an OR result, where anything which matches either condition will be returned.

               

              When you put multiple attributes into the same request form, you get only results where attribute_a AND attribute_b  both match (or more, depending on how many values you enter).

               

              When working with a small number of records, especially test sets, it is often difficult to see a difference in the results of the different types of searches, as one may have too few examples to cause unwanted records to match. When working with sets of thousands of records, the difference in results can be quite significant. If you had some Claim Forms for Jones as well as Smith, you would see the Jones name appear in the found set as well for the original search system you described.

              1 of 1 people found this helpful
              • 4. Re: Three Level Find Request Script
                JFWX5

                Stephen,

                 

                So how would I script create the script to do that?

                 

                Thanks

                 

                John

                • 5. Re: Three Level Find Request Script
                  Stephen Huston

                  Chad's sample script in his first response looks good. The catch being you set all the fields you want in a single request -- no New Record step involved unless you want an OR result — where you'd also get the Jones Claim Forms.

                  • 6. Re: Three Level Find Request Script
                    JFWX5

                    Stephen & Chad

                     

                    I somewhat need the OR result.

                     

                    But not the Jones record.

                     

                    So I've come up with:

                     

                    Enter Find Mode

                     

                    Set Field "Client Name"; "Smith"

                     

                    New Record / Request

                     

                    Set Field "Record Type" ; "Claim Form"  or  "Death Certificate"

                     

                    Perform Find

                     

                    This would result in the proper sub-set of records being found.

                     

                     

                    Thank you,

                     

                    John

                     

                    Bouncing this off others makes the mind see things other ways.

                    • 7. Re: Three Level Find Request Script
                      erolst

                      JFWX5 wrote:

                      I somewhat need the OR result.

                      But not the Jones record.

                      […]

                      This would result in the proper sub-set of records being found.

                       

                      It wouldn't (and it isn't correct syntax anyway). What you need is:

                       

                      Enter Find Mode

                      Set Field [ YourTable::Client Name ; "Smith" ]

                      Set Field [ YourTable::Record Type ; "Claim Form" ]

                      Duplicate Record / Request

                      Set Field [ YourTable::Record Type ; "Death Certificate" ]

                      Perform Find

                       

                      This will find all records where name = smith AND type = ("claim form" OR "death certificate")

                      • 8. Re: Three Level Find Request Script
                        Stephen Huston

                        Ues, the Duplicate Record / Request keeps the "Smith" in each piece, while the Set Field after the Duplicate step modifies the first request.

                         

                        Keep in mind, John, the any request which lacks the Smith part will return All records which match, whether Smith or Jones, or anything else. Each separate request form results in an OR result which is as wide open as that request. You need the name in each part to restrict to a single name.

                         

                        Another scripted approach would be to perform a mutli-part Find and then follow it up with a Constrain Found Set to "Smith", which would remove all non-Smith records from whatever was found first. There are times when that is easier to script, but it might be much slower or much faster, or about the same speed to perform, depending on your data structure and record volume.