Edit Key tables

Hi

i have this structure in my app
image

“companys” are all customers or non-customers. The “clients” table are always clients.

In the “Companys” table you can insert a new company, let’s give an example with the name “JUBE” but that is not a client yet. Your key in the “companys” table is the company_id which can be for example “1034A”. The company “JUBE” then becomes a client and appears in the “Clients” table with an automatically generated company_ID

Now I needed to go to the “Companys” table and change the company_id to the company_id of the “Clients” table to be linked with the “Companys” table How can I do this knowing that the company_id is the key

Can you help please

A row’s key column value cannot change once the row is saved the first time.

1 Like

In this situation how to solve this problem to create the app

How can we resolve this problem ? Anybody know?

Hi @Tiago_Pereira

You may want to use a bot to add a new row in the “Companys” table, everytime you add a row to the Clients, or People, or Visit.
And this table will need to have minimal columns:

  • key_column, type Text, with initial value: UNIQUEID()
  • client: type Ref, source table: Client
  • people: type Ref, source table: People
  • visit: type Ref, source table: Visit

You will need to use some tricks :slight_smile:
Here are some documentation that may help you into achieving your goal, depending on it.

1 Like

Thanks a lot for the tricks

1 Like

You are welcome