Subject | Re: [IBO] Duplicate a record |
---|---|
Author | Lukas Zeller |
Post date | 2000-12-03T22:52:42Z |
At 23:54 02.12.00 -0700, you wrote:
But DefaultValues? Im not quite sure, as I use (client side, IBO) default
values
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).
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
InsertCopyFrom(aDataSet:TIB_Dataset)
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 Zrich Tel: +41 1 440 66 00, Fax: +41 1 440 66
04 info@..., http://www.synthesis.ch
>Do you like the sound of an InsertCopy method that will insert a copy of theYeeeeees:-) this would be great!
>existing record?
>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. TheyGeneratorLinks, certainly!
>would apply over the top of the copied values.
But DefaultValues? Im not quite sure, as I use (client side, IBO) default
values
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
InsertCopyFrom(aDataSet:TIB_Dataset)
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 Zrich Tel: +41 1 440 66 00, Fax: +41 1 440 66
04 info@..., http://www.synthesis.ch