Discussions

Expand all | Collapse all

Primary Key change

  • 1.  Primary Key change

    Posted 05-03-2021 17:17

    Hi Folks,
    Currently, my tables are using a text field as a primary key. I am planning to change it from Text to Record ID#.
    Can any of you help with the DO'S and DONT's that I need to follow before doing the change.

    Thanks in Advance



  • 2.  RE: Primary Key change

    Posted 05-03-2021 18:20

    Firstly, you can always copy your app and do the change there, just to practice and see in advance what it will do.

    You will set the Key field and it will give you two scary warnings and then in a blink it will change the Key field and update all the child records so they stay connected to their original parents.


    Then you will go to each affected relationship to identify a Proxy field for the [Record ID#] field.  For example if the Customer name was the Key field of the Customers table and now you want to go to [Record ID#],  then you go to the Related Customer field, remove the (ref) suffix which QuickBase added, and set the Proxy for [Related Customer] to be Customer name.

    Then go to the form on the child record and make sure that Customer Name is on the form and Related Customer is not.

    Then test the drop down for choosing the customer. (Parent) 



    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Primary Key change

    Posted 05-03-2021 18:51
    Edited by Mike Tamoush 05-03-2021 20:43
    Edit: I wrote everything below before read Mark's reply. Mark, I seem to remember it did not re-associate the children when I went from text to numeric (only if I went from numeric to numeric). Perhaps I am misremembering? Mark has way more experience, so you may be able to ignore everything I wrote below!

    ----------------------------------------------

    [Deleted Response]

    ------------------------------



  • 4.  RE: Primary Key change

    Posted 05-03-2021 19:27
    The children will absolutely 100% stay attached to the parents.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: Primary Key change

    Posted 05-03-2021 20:41
    Mark,

    It dawned on me the reason I had issues was due to my cross-app relationships. Thanks for setting this all straight!

    ------------------------------
    Mike Tamoush
    ------------------------------