3 Replies Latest reply on Oct 14, 2010 1:10 PM by rowing190

    updating two distinct fields

    rowing190

      Title

      updating two distinct fields

      Post

      I have fields A & B in two different databases, X & Y.

      I am hoping to find a way that when I create a new record in database X and add a new value in field A that the same process is automatically repeated in database Y and field B - that is, a new record is created in database Y with the exact same value in field B that was just added in field A in database X.

      I have created a simple script that allows me to import the all of the records from database X with the contents of field A into field B in database Y , but was hoping that there might be another more efficient way to do this.

      I do not simply want to map field A of database X to database Y.

      Thanks for any help that you can offer.

      rowing190

        • 1. Re: updating two distinct fields
          LaRetta_1

          Hi rowIng190,

          The simple answer is to related the tables and then no transfer of data is even necessary except for a single 'key' field which defines what they have in common.

          It is difficult to envision what you are doing when you use generic A & B and X and Y.  Please tell us what these tables represent, what field data you think should be 'transferred' and why you do not want to 'map' the tables together.  If they should share information then they certainly are related.  More information (including your FM version) is required before we can offer anything meaningful.

          • 2. Re: updating two distinct fields
            LaRetta_1

            Also, you mention 'database' and that phrase hasn't applied to FileMaker since vs. 7.  We now use tables and files.  So are the two databases individual tables within one file or are they two different files?

            • 3. Re: updating two distinct fields
              rowing190

              Hi LaRetta:

              My company has a fairly complicated system of creating job titles as well as the larger groups to which those titles are smaller subsets. That is, each title in our title code file also belongs to a grouping of titles that we call title groups. A title code may belong to as many as 10 title groups. The reason for this system is that it makes it easy for our Marketing Department to request different groupings of titles for a specific marketing campaign.

              For example.

              Title Code = AD (Art Director)

              Title Group 1 = Creative Staff (Art Directors and Creative Directors)

              Title Group 2 = Creative and Design Staff (Art Directors, Creative Directors, Graphic Designers.

              Title Group 3 = Creative, Design, and Print Production Staff

              For the purposes of data entry, and for assuring that the correct title groups have been assigned to each title code, the title code table contains fields for both the title and the title groups (as in the example above).

              For the purposes of querying our contact file, we have two more files - a contact title file and a title groups file. The contact title file that contains two fields - the unique indentifier for each contact in our contact file and a title code field. It is related to the contact file through the unique identifier. Since a contact may have multiple titles - Art Director and Principal, the contact title file would have two records for that unique identifier. The title group file contains two fields - the title code field and the title group field. It is linked to the contact title field through the title code. This relationship allows for queries to be run in the contact table using the title groups.

              So I have mentioned four files - the contact file (which contains each individual contact), title code table (for creating new title codes and their corresponding title groups), contact title table and title group table.

              My question regards the title code table. When a new title code and its corresponding title groups is created in a new record in the title code table, I was wondering whether there is a script that can be created by which a new record with title code and title group 1, then a new record with the title code and title group 2 can be automatically created in the title group file. The purpose of this is simply to cut down on the risk that new title codes and their corresponding title groups are not added to the title group table. I do have an import script that will allow me to simply delete all records in the title group table and then import all of the data from the title code table from scratch. This may be the best way to go, but wondered if someone knows better than I.

              rowing190