2 Replies Latest reply on Feb 24, 2015 3:44 PM by episking

    Shared serial number between tables.

    episking

      Title

      Shared serial number between tables.

      Post

      I have Table A, which has a parent/primary key used for related records of docKeyA (Table A sub A, Table A sub B, etc.), I have Table B which has a parent/primary key used for its related records of docKeyB (Table B sub A, Table B sub B, etc).  

      Table C is one that will have records that are related exclusively to Table A, as well as records that are related exclusively to Table B.  Table C will be child records of both Table A and Table B.  My issue is that docKeyA and docKeyB are Auto-Entered Serials, so when Table C inherits the docKey from Table A or Table B, there will be duplicates.  How can I avoid this?

      I assume there will be some way to use a Get(UUID) as the docKey, but I still need to have an easily identifiable number to identify each record in Table A, B and C... (like, 1, 4124, or 12,234).  Is there a way I can set up another table that Table A and Table B query to get the next number in the series?  This seems like the best course of action...

      Thanks for your replies!!

      -EP

       

       

        • 1. Re: Shared serial number between tables.
          philmodjunk

          Use two different match fields in Table C. One to match to records from Table A and One to Match to records from Table B. This way a duplicate value in a match field of Table C still does not create confusion as to which record of which table it is linked.

          Get (UUID) could be used to link records here and then you would not need two match fields in Table C.

          Before Get ( UUID ) was an option we would sometimes define a "prefix" value as part of the serial number such that all serial numbers from one table started with the same characters as  a way to ensure distinct Serial ID values.

          Other options are also possible such as setting up a fourth table as a source of serial numbers for both Table A an Table B as a way to keep the same ID from being used twice between records of these two tables.

          • 2. Re: Shared serial number between tables.
            episking

            Use two different match fields in Table C. One to match to records from Table A and One to Match to records from Table B. This way a duplicate value in a match field of Table C still does not create confusion as to which record of which table it is linked.

            LOL!  Yes, this is a great idea.

            -EP