Subject Re: [IBO] Duplicate a record
Author Lukas Zeller
At 23:54 02.12.00 -0700, you wrote:
>Do you like the sound of an InsertCopy method that will insert a copy of the
>existing record?
Yeeeeees:-) this would be great!

>Shall I add a button for it on the TIB_UpdateBar?
Yes, but probably one that is by default not in VisibleButtons.

>Also, I would be sensitive to the GeneratorLinks and DefaultValues. They
>would apply over the top of the copied values.
GeneratorLinks, certainly!
But DefaultValues? Im not quite sure, as I use (client side, IBO) default
for most fields to have a record with values that make some sense to start
with. But when I duplicate a record I wouln't want those defaults, but copied
values. My favorite luxurious solution would be a new field attribute
'NODUP' to
prevent a field from being duplicated (so the default would apply). A simpler
solution would be a parameter to InsertCopy(aApplyDefaults:boolean).

>Any other thoughts for this?
When you are at it, probably a more general way for creating a new record
from a template could be implemented. I often use a second query that selects
some flagged records of the main table and presents them as templates in
a Combo or ListBox. For this, something like
would be very handy. It would work like InsertCopy above, but for each
target field
it would take the value of the field in aDataSet with the same name. Of course,
I can (and do) implement this in a simple loop in OnNewRecord, but a general
solution would be more elegant...

Regards, Lukas

Lukas Zeller (luz@...), Direktwahl +41 1 440 66 01 -- Synthesis
AG, Rosengartenstr. 1a, 8037 Z┬črich Tel: +41 1 440 66 00, Fax: +41 1 440 66
04 info@...,