4 Replies Latest reply on May 13, 2009 4:10 AM by DonorTracker

    how to save collections of records?

    DonorTracker

      Title

      how to save collections of records?

      Post

      If I do a mailing, I may start with a set of criteria that could be a saved search, but usually I then want to omit some additional records manually, using Omit Record.

       

      What is the best strategy for saving this collection of records? Thanks!

        • 1. Re: how to save collections of records?
          davidhead
            

          The best way would probably be to have a relational structure between tables such as:

           

          CONTACT ---< ContactSearch >--- SEARCH

           

          So in the Search table, you create records that correspond to the collections of records you want to save e.g. people from Sydney with red hair.

           

          The ContactSearch table is a join table. So when you have a set of contact records you want to save, you run a scripted process to create and name a new search record, and then import the contact IDs into the join table, and tag them with the search ID.

           

          If you need help with the structure or scripting, just ask. 

          • 2. Re: how to save collections of records?
            DonorTracker
              

            uLearnIT wrote:

            The best way would probably be to have a relational structure between tables such as:

             

            CONTACT ---< ContactSearch >--- SEARCH

             

            So in the Search table, you create records that correspond to the collections of records you want to save e.g. people from Sydney with red hair.

             

            The ContactSearch table is a join table. So when you have a set of contact records you want to save, you run a scripted process to create and name a new search record, and then import the contact IDs into the join table, and tag them with the search ID.

             

            If you need help with the structure or scripting, just ask. 


            Yes, please! I would appreciate some help with the structure -- and probably then with the scripting.

             

            The conceptually simpler (though Neanderthal) approach would be, I suppose, to just keep adding a new checkbox field to my records every time I do a new mailing.


            • 3. Re: how to save collections of records?
              davidhead
                

              This would be your structure with three tables:

               

              CONTACT         CONTACTSEARCH         SEARCH 

                                     ID

                ID    ------<    ID contact 

                                     ID search  >-----   ID

              First name                                  Search name

              Last name                                  Created by

              etc.

               

               

              For the scripting, it would be driven from the Contact table when you have a found set of records you want to keep. You would attach the script to a button on a Contact layout. Given that you have layouts for Contact, ContactSearch and Search, the script could look like this:

               

              # SCRIPT: Store Found Set 

              # Create a new search record and store the number 

              Go to Layout [ “SEARCH” (SEARCH) ] 

              New Record/Request 

              Show Custom Dialog [ Title: "Stored Set"; Message: "Please name this Stored Set"; Buttons: “OK”; Input #1: SEARCH::search 

              name, "Name" ] 

              Set Variable [ $ID; Value:SEARCH::ID ] 

              # Import contact IDs into ContactSearch table, tag with search ID 

              Go to Layout [ “CONTACTSEARCH” (CONTACTSEARCH) ] 

              Import Records [ Source: “file:Saved Searches.fp7”; Target: “CONTACTSEARCH” ] [ No dialog ] 

              Replace Field Contents [ CONTACTSEARCH::ID search; Replace with calculation: $ID ] [ No dialog ] 

              # Return to Contacts 

              Go to Layout [ original layout ] 

               

              See how that goes for you. It does need some error trapping (e.g. making sure a unique name is provided for each stored search) but it should get you started. 

              • 4. Re: how to save collections of records?
                DonorTracker
                  

                Thank you.  I shall study this further on the morrow.

                 

                Update: I have filed your post for future reference.  Unfortunately my need to get work done (as opposed to furthering my FM programming skills) has required me to use the aforementioned "Neanderthal" alternative for my immediate mailing task.

                 

                I apologize for asking for this much help and not being able to follow through at the moment.  But again, thank you!