1 (edited by v_pozidis 2016-07-22 09:51:35)

Topic: Double Copy Record

Hi all,
Is it possible to double copy a record ?
In my software I have tables with relationships us City and Areas.
So what I like to do is instead to write all the time the same things with one click it should copy the  records to a new one.
The most of the employees are from the same city and same and much more.
This example is not only for employees but with a copy you can create a new record for a product that is a newer version.
Thank you in advance.

Re: Double Copy Record

In other words, you want to duplicate and edit an existing record as a new one at the same time?

3 (edited by v_pozidis 2016-07-22 14:28:56)

Re: Double Copy Record

Not necessary at the same time, but if it is also possible why not

Re: Double Copy Record

Hello V_Pozidis,

I do something similar where a new record is created based on an existing record with only one or two small changes (a copy/create).  Basically,
1)  the user selects an existing row in the tablegrid that he wants to use as a basis for the copy/create
2)  clicks 'copy'
3)  the chosen row is displayed (read only) so the user can verify the correct row is being used as the basis for the copy/create
4)  any changes are made as required
5)  click 'save'  and the new row is created.
I have attached a simplified version of my project for you to see it working.  Maybe this will help you.
Derek.

Post's attachments

Attachment icon pozidis copy.zip 338.25 kb, 483 downloads since 2016-07-23 

5 (edited by v_pozidis 2016-07-23 17:56:47)

Re: Double Copy Record

Thanx, but could it also work with relations?
I send you my example adding in the software you send me.

Post's attachments

Attachment icon pozidis copyWithRealtion.zip 660.41 kb, 480 downloads since 2016-07-23 

Re: Double Copy Record

Hello,
Yes, you can get the values for comboboxes in your script in the same way as for edit fields.  I have attached your example (with the 'teams' relationship) showing this.
Hope it helps.
Derek.

Post's attachments

Attachment icon pozidis copy with relationship.zip 339.58 kb, 489 downloads since 2016-07-23 

7 (edited by v_pozidis 2016-07-24 12:41:14)

Re: Double Copy Record

Yes it works and something difficult.
How does it works if we have another table for the phone numbers ?
Watch my example.
Thank you in advance

Post's attachments

Attachment icon pozidis copy with relationshipAndPhones.zip 330.13 kb, 490 downloads since 2016-07-24 

Re: Double Copy Record

Hi,
One way to do it would be to save the 'copy / create' record and then select, one at a time, from a second tablegrid, the phone numbers you also want to 'copy / create'.   I've attached an example of how I might do it, but I imagine there are other ways too.
Another option might be to use the 'go multiselect' option on the tablegrid that contains the phone numbers.  I've used 'go multiselect' to delete multiple rows so I can't see any reason why it wouldn't work with inserts, although I've not tried it.
Derek.

Post's attachments

Attachment icon pozidis copy with relationship.zip 343.51 kb, 587 downloads since 2016-07-25 

Re: Double Copy Record

Thank you Derek for your time.