3 Replies Latest reply on Jul 26, 2013 5:38 AM by mikebeargie

    Need to replace existing keys in older solution

    robbiegiroux

      I am updating an older solution that used mall names for a key field that linked each mall to the stores in it.

       

      I would prefer to change that to a serial number without replacing the mall name directly. I have kicked it around some and keep getting wierd results - data not showing on one side or the other. Is there a straightforward way to accomplish this?

       

      Thanks

      Robbie G

        • 1. Re: Need to replace existing keys in older solution
          mikebeargie

          You should just have to:

           

          1) Create a new field in the parent table, number field, auto-enter serial

          2) Do a replace in the new field of the parent table (ctrl + = ) in browse mode while showing all records. Select from the popup "replace with serial numbers", and check the box that says "auto-update field options" so it saves the next serial number value.

          3) add a portal of the related child records, as is, to the parents table form view.

          4) Add a new field number field in the child table. Add this field to the portal

          5) Do a replace in this field in the portal, calculate the value to be parentTable::keyField so it replaces the new keyfield from the parent record into all the child records in the portal.
          6) Once confirmed that the parent and child record numbers match, then you can change the relationship so the parent serial = the child number field.

           

          you have to do a replace through the old relationship first before you change it to the new keyfield based relationship.

          • 2. Re: Need to replace existing keys in older solution
            robbiegiroux

            Thanks Mike - I knew the answer had to be staring me right in the face! You are the best.

            • 3. Re: Need to replace existing keys in older solution
              mikebeargie

              There still might be some wierd data, using a non-unique serial key in a relationship always leaves the risk for overlaps and dupes. But I'm glad this will at least get you started. Good luck!