How to insert a select row in another table?

Could someone help me?

I. After a search i see in a form called “clients” a number of rows: each one for one different client.

II. At this point i would select one of this rows and insert it in another field called “myclient” of another form called sales?.

III. Is it possible? If yes, how to do?

Tanks in advance

Gianni Pinna.

Sure this is possible, you would have to write a method to:

  • create a new record in the other table;
  • copy the fields you want to be copied into the new table;

That’s all…

Do you just want to copy the client ID or an entire row? Are you having two table that have the same columns? If yes than you might want to have a close look at your database model first.

You can create new rows on another form very easily. In the method on that form navigate to the form you want to create the record on click on it’s controller object and doubleclick the newRecord item. Once you have that you can start setting data by doubleclicking the dataproviders on the desitination form typing = then clicking the dataproviders you want assigned to them on your original form.

Dear Mr. Jan Aleman,

many tanks for your prompt replay and luminous distinction.
The matter is as later on. It is ordered according to form later on:

Form.clients
-Table.clients
-fields: -clientsID
-name
-address
-phone
-etc…

Form.sales
-Table.sales
-fields: -number
-date
-client_name |
-client_ID > I am interested to put in a row of sales
-client_address | only 3 fields of 1 row clients.
-item
-etc…

The origin of problem was this: that an operator wich is working on the Form.sales, when he arrives to client have the possibility of made 2 quickly:

  1. To choose one of clients whose name starts vith “string%” [ The Forum helped me in this];
  2. Insert with a click in the form.sales and in the table.sales, not all the choosed row of clients, but only 3 (some) filelds of clients..
    Please Mr. Aleman, i am beginning with Servoy and Jscript and my knowledge is rudimentary. Kyndly could you write code?

Create a method on the form clients that looks like this:

forms.sales.controller.newRecord()
forms.sales.clientID = clientID
//repeat the line above for each column you want to move

Dear Mr Aleman,

i hope You’l find replay for any problem of Your life as soon as You kindly answered me. I will test immediatly.

Happy Sunday
Best regards
Gianni Pinna