Subject | Re: [IBO] Fill field's value with it's default value at runtime |
---|---|
Author | Jason Wharton |
Post date | 2002-06-14T16:26:44Z |
DefaultValue isn't intended to be used this way. If there is a default value
setting made then it will plug it in upon going into insert state. If you
are relying upon the servers defaults and you set GetServerDefaults to true
then it will query them in at time of going into insert state. (NOTE:
GetServerDefaults doesn't work perfectly for all types of defaults.)
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
setting made then it will plug it in upon going into insert state. If you
are relying upon the servers defaults and you set GetServerDefaults to true
then it will query them in at time of going into insert state. (NOTE:
GetServerDefaults doesn't work perfectly for all types of defaults.)
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "Hie Joen" <hiejoen@...>
To: <ibobjects@yahoogroups.com>
Sent: Friday, June 14, 2002 3:35 AM
Subject: [IBO] Fill field's value with it's default value at runtime
> Dear List,
>
> Is there a way to fill field's value with it's value at runtime w/o
> knowing the data type ? I can't find a specific one.
>
> Scenario:
> I have FieldA, FieldB, FieldC, FieldD
> If FieldA contains specific value (entry by user) FieldB..FieldD should
> filled with their default value.
>
> In TIB_Column.INT I found private member FDefaultValue. I try to add a new
> public method for this purpose.
>
> My implementaion is:
>
> procedure TIB_Column.SetToDefaultValue;
> begin
> if IsDefaulted then
> SetAsVariant(FDefaultValue)
> else
> Clear;
> end;
>
>
> It's work. Any side effects with above code ?
>
>
> TIA
> HJ