TDACustomField

Overview

TDACustomField expands the abstract TDABaseField to add properties and methods needed for field definitions in data tables, both in the schema and data dictionaries as well as in live TDADataTables.

Location


 

constructor Create  override

Creates a new instance.

constructor Create(Collection: TCollection)

Parameters:

  • Collection: collection which the field belongs to

Alignment

Sets the display alignment used for this field in visual data controls.

property Alignment: TAlignment read write

AsAnsiString    (declared in TDABaseField)

Gets or sets the value of the field as 8-bit ANSI string value.

property AsAnsiString: string read write

AsBlob    (declared in TDABaseField)

Gets or sets the value of the field as Blob value.

property AsBlob: TBlobData read write

AsBoolean    (declared in TDABaseField)

Gets or sets the value of the field as Boolean value.

property AsBoolean: Boolean read write

AsByte    (declared in TDABaseField)

Gets or sets the value of the field as Byte value.

property AsByte: Byte read write

AsBytes    (declared in TDABaseField)

Gets or sets the value of the field as Bytes value.

property AsBytes: TBytes read write

AsCardinal    (declared in TDABaseField)

Gets or sets the value of the field as Cardinal value.

property AsCardinal: Cardinal read write

AsCurrency    (declared in TDABaseField)

Gets or sets the value of the field as 64-bit fixed point Currency value.

property AsCurrency: Currency read write

AsDateTime    (declared in TDABaseField)

Gets or sets the value of the field as TDateTime value.

property AsDateTime: TDateTime read write

AsDecimal    (declared in TDABaseField)

Gets or sets the value of the field as binary coded decimal value.

property AsDecimal: TBcd read write

AsFloat    (declared in TDABaseField)

Gets or sets the value of the field as Float/Double value.

property AsFloat: Double read write

AsGuid    (declared in TDABaseField)

Gets or sets the value of the field as TGUID value.

property AsGuid: TGUID read write

AsInteger    (declared in TDABaseField)

Gets or sets the value of the field as 32-bit integer value.

property AsInteger: Integer read write

AsLargeInt    (declared in TDABaseField)

Gets or sets the value of the field as 64-bit integer value.

property AsLargeInt: Int64 read write

AsLargeUInt    (declared in TDABaseField)

Gets or sets the value of the field as 64-bit unsigned integer value.

property AsLargeUInt: UInt64 read write

AsShortInt    (declared in TDABaseField)

Gets or sets the value of the field as ShortInt value.

property AsShortInt: ShortInt read write

Assign  override

Assigns the Source field.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AssignField  override

Assigns the Source field

procedure AssignField(Source: TDABaseField)

Parameters:


AsSingle    (declared in TDABaseField)

Gets or sets the value of the field as Single value.

property AsSingle: Single read write

AsSmallInt    (declared in TDABaseField)

Gets or sets the value of the field as SmallInt value.

property AsSmallInt: SmallInt read write

AsString    (declared in TDABaseField)

Gets or sets the value of the field as string value.

property AsString: string read write

AsVariant    (declared in TDABaseField)

Gets or sets the value of the field as variant.

property AsVariant: Variant read write

AsWideString    (declared in TDABaseField)

Gets or sets the value of the field as 16-bit Unicode WideString value.

property AsWideString: UnicodeString read write

AsWord    (declared in TDABaseField)

Gets or sets the value of the field as Word value.

property AsWord: Word read write

AsXml    (declared in TDABaseField)

Gets or sets the value of the field as XML node.

property AsXml: IXMLNode read write

Bind (IDANativeField)  overload

Sets IDANativeField member properties of the class in the case of using non-dataset compatible driver. Used for internal operations.

procedure Bind(aField: IDANativeField)

Parameters:

  • aField: this parameter implemented by non-dataset compatible driver, to which TDACustomField should be bounded to.

Bind (TField)  overload

Sets internal TField member of the class. Used for internal operations only such as for initializing data table process, opening clone cursors, etc.

procedure Bind(aField: TField)

Parameters:

  • aField: TField instance to which current field should be bind to

BlobSize    (declared in TDABaseField)

Indicates the number of bytes of data contained in the blob field on the current record.

property BlobSize: Integer read

BlobType    (declared in TDABaseField)

Manages additional Blob options, if the DataType of the field is set to datBlob.

property BlobType: TDABlobType read write

BoundedField

Returns TField member of TDACustomField class

property BoundedField: TField read

BoundedNativeField

Returns IDANativeField member of TDACustomField class

property BoundedNativeField: IDANativeField read

BusinessClassID

The property is used for implementing business rules logic on a field level. Should be set to the registered name of field business rule. Look for example in the article

property BusinessClassID: string read write

Calculated

Indicates whether this field is Calculated, or not. Calculated fields do not have direct a physical representation on the database, their value is instead generated on the fly, client side, based on other fields in the same record. For example, a calculated Fullname field could obtain its value by concatenating FirstName and LastName. Calculated fields usually are read-only and do not log changes (since there is no storage space where such changes could be persisted in the database).

property Calculated: Boolean read write

Clear    (declared in TDABaseField)

Clears the value of the field by setting it to Null.

procedure Clear

CustomAttributes

Allows the storage of custom, user-defined attributes. This string list will not be evaluated by the Data Abstract library, but it can be used to add custom information to your schema at design time which will later be evaluated by your own client or server-sided code. For example, CustomAttributes could be used to store additional display properties that will be evaluated by the client when displaying data.

property CustomAttributes: TStrings read write

DataType    (declared in TDABaseField)

Specifies the type of data contained within the field, from a collection of supported TDADataTypes. Depending on the data type, the Size and BlobType properties are also used to further define the data type in more detail. For datString and datWideString, Size will define the maximum length of string permitted for the field; for blobs and memos, BlobType provides special options.

property DataType: TDADataType read write

DecimalPrecision    (declared in TDABaseField)

Specifies decimal precision for a binary coded decimal value (if the DataType of the field is set to datDecimal).

property DecimalPrecision: Integer read write

DecimalScale    (declared in TDABaseField)

Specifies decimal scale for a binary coded decimal value (if the DataType of the field is set to datDecimal).

property DecimalScale: Integer read write

DefaultValue

Defines a default value to be written to the field when adding new records, client-side.

property DefaultValue: string read write

Description    (declared in TDABaseField)

Provides a human-readable description of the field. This property will not be used by the Data Abstract library, but can be filled with description text for documentation purposes when defining the field or parameter in Schema Modeler.

property Description: string read write

DictionaryEntry    (declared in TDABaseField)

Name of the data dictionary for the field

property DictionaryEntry: string read write

DisplayFormat

Sets the display format used for this field in visual data controls. Please refer to the Delphi documentation for TField and related classes for details on the syntax for formatting the field values.

property DisplayFormat: string read write

DisplayLabel

Specifies the display label or caption used for this field in visual data controls. By default, this value will be identical to the field's Name.

property DisplayLabel: string read write

DisplayWidth

Sets the display width, in characters, used for this field in visual data controls.

property DisplayWidth: Integer read write

EditFormat

Defines the editing format used for this field in visual data controls. Please refer to the Delphi documentation for TField and related classes for details on the syntax for formatting the field values.

property EditFormat: string read write

EditMask

This is the editing mask for this field in visual data controls. Please refer to the Delphi documentation for TField and related classes for details on the syntax for edit masks.

property EditMask: string read write

Expression

Pascal Script expression that is used for evaluating value of Calculated Fields with the help of TDAStdExpressionEvaluator

property Expression: string read write

FieldCollection

Returns the collection that this field belongs to. Typically, this will be the Fields property of the TDADataTable (if the field is part of a live data table) or schema TDADataset (if the field is part of a schema definition).

property FieldCollection: TDACustomFieldCollection read

FocusControl

Forces a form's focus to the first data-aware component associated with the field object.

procedure FocusControl

GeneratorName    (declared in TDABaseField)

For fields of type datAutoInc, this property specifies the name of the generator in the back-end database that will be used to generate new primary key values. This applies only to database types that do not natively support AutoInc fields (such as Oracle or Interbase). Please refer to the AutoIncs and Generators help topic for more detail.

property GeneratorName: string read write

GetDisplayName  protected override    (declared in TDABaseField)

Returns Name of the field

function GetDisplayName: string

GetIsNull  protected override

Returns whether the field currently contains a value (false) or is Null (true).

function GetIsNull: Boolean

GetNamePath  override

Returns the name of the object as it appears in the Object Inspector

function GetNamePath: string

GetOwner  protected override

Returns collection which the field belongs to

function GetOwner: TPersistent

HasValidDictionaryField  override

Indicates if the field has appropriate data dictionary entry

function HasValidDictionaryField: Boolean

Ignored

Indicates that this field won't be fetched from DB server

property Ignored: Boolean read write

InPrimaryKey

Indicates whether this field is part of the primary key for the dataset. The primary key (or short PK) consists of the field or fields that uniquely identify each record in a dataset and, eventually, the underlying database table. Please refer to your database system's documentation and general database design guidelines for more information on primary keys.

property InPrimaryKey: Boolean read write

IsCompatibleV4  protected override

Specifies DA4 compatible mode.

function IsCompatibleV4: Boolean

IsNull    (declared in TDABaseField)

Returns whether the field currently contains a value (false) or is Null (true).

property IsNull: Boolean read

KeyFields

Holds the key field or key fields that contain the original value to be looked up on the LookupSource.

property KeyFields: string read write

LoadFromFile

Loads BLOB data from a file into the field, if DataType of the field is datBlob

procedure LoadFromFile(const aFileName: string)

Parameters:

  • aFileName: the name of the file to load into the field

LoadFromStream (IROStream)  overload

Loads BLOB data from a IROStream's underlying stream into the field, if DataType of the field is datBlob

procedure LoadFromStream(const aStream: IROStream)

Parameters:

  • aStream: stream from where field should be loaded

LoadFromStream (TStream)  overload

Loads BLOB data from a stream into the field, if DataType of the field is datBlob

procedure LoadFromStream(const aStream: TStream)

Parameters:

  • aStream: stream from where field should be loaded

LogChanges

Decides whether changes to this field should be logged as part of the delta so they can layer be applied back to the server. When set to false, the client application will keep no record of changes made to these fields, and any changes made by client application will be lost when the client restarts or refreshes data from the server.

property LogChanges: Boolean read write

Lookup

Indicates whether the field is a Lookup Field, whose value will be determined at runtime by looking up values from a different dataset. Similar to calculated fields, lookup fields are not direct representations of a field in the back-end database, but are filled at runtime, usually by using a Foreign Key Relationship to look up values from a secondary table. For example, an Orders table might store a CustomerID field, and additionally have a CustomerName lookup field defined, which will be filled by obtaining the appropriate name (the LookupResultField) from the Customers table (the LookupSource), using the CustomerID (the LookupKeyFields).

property Lookup: Boolean read write

LookupCache

Toggles whether values for lookup fields will be cached (true) or reevaluated whenever they are needed. Set this property to true for optimal performance, if data in your lookup source changes rarely; set it to false to make sure your lookup values are always up to date if your data changes frequently.

property LookupCache: Boolean read write

LookupKeyFields

Specifies the key field or key fields that will be used on the LookupSource to locate the appropriate record.

property LookupKeyFields: string read write

LookupResultField

Sets of the name of the field (in the LookupSource) that contains the result value for the lookup. This field's value will be used as the value for the lookup field itself.

property LookupResultField: string read write

LookupSource

Defines the TDataSource that will used as the source to look up field values.

property LookupSource: TDataSource read write

MergeDatadictionaries  protected override

One of the conditions for indicating if the field's property should be saved on the form or when TDASchema is saved. For internal using.

function MergeDatadictionaries: Boolean

Name    (declared in TDABaseField)

Defines the name of the field or parameter. This name usually matches the name of the underlying field in the physical database, or it's mapped to a different field using the data tables column mapping.

property Name: string read write

OldValue

Contains the original value of a changed field. If LogChanges is active for a field, the data table will maintain a log of all changes made to the records, until the changes are applied back to the back-end database. After a field's value has changed, this property will give you access to the original value that was obtained from the database. For obvious reasons, OldValue will not be available for newly inserted records.

property OldValue: Variant read

OnChange

Fires whenever the value of a particular field has been changed.

property OnChange: TDAFieldNotifyEvent read write
delegate: procedure OnChange(Sender: TDACustomField)

OnGetText

Occurs when the DisplayText or Text property of the field is referenced.

property OnGetText: TDAFieldGetTextEvent read write
delegate: procedure OnGetText(Sender: TDACustomField; var Text: string; DisplayText: Boolean)

OnSetText

Occurs when the Text property is assigned a value.

property OnSetText: TDAFieldSetTextEvent read write
delegate: procedure OnSetText(Sender: TDACustomField; const Text: string)

OnValidate

Fires whenever the value of a particular field is about to change, given the event handler opportunity to validate and possibly reject the change by raising an exception.

property OnValidate: TDAFieldNotifyEvent read write
delegate: procedure OnValidate(Sender: TDACustomField)

Private

Indicates that this field will be accessible on server-side only

property Private: Boolean read write

QueryInterface  protected stdcall    (declared in TInterfacedCollectionItem)

Returns a reference to a specified interface if the object supports that interface. This is one of the methods introduced by the IUnknown interface.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: Variable to store the returned interface reference to

ReadOnly

Indicates whether the values contained in this field can be changed (false) or not.

property ReadOnly: Boolean read write

RegExpression

Sets a Regular Expression that will be used to validate values entered into this field. Any change that does not match the regular expression will be rejected.

property RegExpression: string read write

Required

Indicates whether the field requires a non-null value, or not. If set to true, data tables will not accept posting of new records or changes to existing records where this field does not contain a value. Note that the Required property merely enforces client-side data entry; it does not necessarily have to match "required" or "not null" settings on the back-end database (although in most scenarios the two will match). It is entirely possible to set a field as "required" although the back-end database in fact does allow nulls, or vice versa (although in the latter case, applying a null value to the back-end database will of course trigger the appropriate error from the database server).

property Required: Boolean read write

SaveToFile

Saves the contents of the BLOB field to a file, if DataType of the field is datBlob

procedure SaveToFile(const aFileName: string)

Parameters:

  • aFileName: the name of the file where field content should be saved to

SaveToStream (IROStream)  overload

Saves the contents of the BLOB field to a IROStream's underlying stream

procedure SaveToStream(const aStream: IROStream)

Parameters:

  • aStream: stream where field content should be saved to

SaveToStream (TStream)  overload

Saves the contents of the BLOB field to a stream

procedure SaveToStream(const aStream: TStream)

Parameters:

  • aStream: stream where field content should be saved to

ServerAutoRefresh

Allows the value of this field to be automatically refreshed from the server as part of an INSERT or UPDATE. Set this value to true if you expect field values to change on the server when records are inserted or updated (for example due to default values or triggers), and you want your client to automatically receive the new value after the change has been processed. If this value is true, the server will generate a new delta record after processing the change, to allow the values to be sent back to the client and merged into the local client-side data table. This behavior is comparable to AutoInc values, which will also automatically be sent back to the client after inserts. See the AutoIncs and Generators help topic for more details. For AutoIncs, server refresh on insert is implicit, and this property does not need to be set to true.

property ServerAutoRefresh: Boolean read write

ServerCalculated

Indicates that value for the field is calculated on the server (either with database trigger or in OnWriteFieldValue event handler of data streamer).

property ServerCalculated: Boolean read write

SetAsAnsiString  protected override

Sets the value of the field as 8-bit ANSI string value.

procedure SetAsAnsiString(const aValue: string)

Parameters:

  • aValue: the value for the field that should be set

SetDisplayName  protected override    (declared in TDABaseField)

Sets the name of the field as it appears in the collection editor.

procedure SetDisplayName(const Value: string)

Parameters:

  • Value: value for the Name property

SetValue  protected override

Sets the value for the field taking into account data type of the Value

procedure SetValue(const Value: Variant)

Parameters:

  • Value:

Size    (declared in TDABaseField)

Sets the maximum length of string permitted for the field, DataType is set to datString or datWideString.

property Size: Integer read write

SQLOrigin

The name of the field returned from data table query (which will be identical to the TableField in most cases, unless your SQL query uses the AS directive to change field names). Used in Column Mappings

property SQLOrigin: string read write

StoreBlobType  protected    (declared in TDABaseField)

Indicates if original field's BlobType property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreBlobType: Boolean

StoreDataType  protected    (declared in TDABaseField)

Indicates if field's DataType property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now.

function StoreDataType: Boolean

StoreDecimalPrecision  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema.

function StoreDecimalPrecision: Boolean

StoreDecimalScale  protected    (declared in TDABaseField)

Indicates if field's DecimalScale property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema.

function StoreDecimalScale: Boolean

StoreDescription  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreDescription: Boolean

StoreGeneratorName  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreGeneratorName: Boolean

StoreSize  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreSize: Boolean

TableField

The name of the field in the back-end database. Used in Column Mappings

property TableField: string read write

Tag    (declared in TDABaseField)

Tag has no predefined meaning. The Tag property can store any additional integer value for the convenience of developers

property Tag: Integer read write

Unbind

Sets all the event handlers of TField member and himself to nil

procedure Unbind

Value    (declared in TDABaseField)

Gets or sets the value of the field as variant.

property Value: Variant read write

Visible

Toggles whether this field should be visible by default in grids and other data-bound controls (true) or not (false). Note that this property only controls the default visibility for "unconfigured" grids and data controls. Individual settings on user controls can override the visibility.

property Visible: Boolean read write

 

Alignment

Sets the display alignment used for this field in visual data controls.

property Alignment: TAlignment read write

AsAnsiString    (declared in TDABaseField)

Gets or sets the value of the field as 8-bit ANSI string value.

property AsAnsiString: string read write

AsBlob    (declared in TDABaseField)

Gets or sets the value of the field as Blob value.

property AsBlob: TBlobData read write

AsBoolean    (declared in TDABaseField)

Gets or sets the value of the field as Boolean value.

property AsBoolean: Boolean read write

AsByte    (declared in TDABaseField)

Gets or sets the value of the field as Byte value.

property AsByte: Byte read write

AsBytes    (declared in TDABaseField)

Gets or sets the value of the field as Bytes value.

property AsBytes: TBytes read write

AsCardinal    (declared in TDABaseField)

Gets or sets the value of the field as Cardinal value.

property AsCardinal: Cardinal read write

AsCurrency    (declared in TDABaseField)

Gets or sets the value of the field as 64-bit fixed point Currency value.

property AsCurrency: Currency read write

AsDateTime    (declared in TDABaseField)

Gets or sets the value of the field as TDateTime value.

property AsDateTime: TDateTime read write

AsDecimal    (declared in TDABaseField)

Gets or sets the value of the field as binary coded decimal value.

property AsDecimal: TBcd read write

AsFloat    (declared in TDABaseField)

Gets or sets the value of the field as Float/Double value.

property AsFloat: Double read write

AsGuid    (declared in TDABaseField)

Gets or sets the value of the field as TGUID value.

property AsGuid: TGUID read write

AsInteger    (declared in TDABaseField)

Gets or sets the value of the field as 32-bit integer value.

property AsInteger: Integer read write

AsLargeInt    (declared in TDABaseField)

Gets or sets the value of the field as 64-bit integer value.

property AsLargeInt: Int64 read write

AsLargeUInt    (declared in TDABaseField)

Gets or sets the value of the field as 64-bit unsigned integer value.

property AsLargeUInt: UInt64 read write

AsShortInt    (declared in TDABaseField)

Gets or sets the value of the field as ShortInt value.

property AsShortInt: ShortInt read write

AsSingle    (declared in TDABaseField)

Gets or sets the value of the field as Single value.

property AsSingle: Single read write

AsSmallInt    (declared in TDABaseField)

Gets or sets the value of the field as SmallInt value.

property AsSmallInt: SmallInt read write

AsString    (declared in TDABaseField)

Gets or sets the value of the field as string value.

property AsString: string read write

AsVariant    (declared in TDABaseField)

Gets or sets the value of the field as variant.

property AsVariant: Variant read write

AsWideString    (declared in TDABaseField)

Gets or sets the value of the field as 16-bit Unicode WideString value.

property AsWideString: UnicodeString read write

AsWord    (declared in TDABaseField)

Gets or sets the value of the field as Word value.

property AsWord: Word read write

AsXml    (declared in TDABaseField)

Gets or sets the value of the field as XML node.

property AsXml: IXMLNode read write

BlobSize    (declared in TDABaseField)

Indicates the number of bytes of data contained in the blob field on the current record.

property BlobSize: Integer read

BlobType    (declared in TDABaseField)

Manages additional Blob options, if the DataType of the field is set to datBlob.

property BlobType: TDABlobType read write

BoundedField

Returns TField member of TDACustomField class

property BoundedField: TField read

BoundedNativeField

Returns IDANativeField member of TDACustomField class

property BoundedNativeField: IDANativeField read

BusinessClassID

The property is used for implementing business rules logic on a field level. Should be set to the registered name of field business rule. Look for example in the article

property BusinessClassID: string read write

Calculated

Indicates whether this field is Calculated, or not. Calculated fields do not have direct a physical representation on the database, their value is instead generated on the fly, client side, based on other fields in the same record. For example, a calculated Fullname field could obtain its value by concatenating FirstName and LastName. Calculated fields usually are read-only and do not log changes (since there is no storage space where such changes could be persisted in the database).

property Calculated: Boolean read write

CustomAttributes

Allows the storage of custom, user-defined attributes. This string list will not be evaluated by the Data Abstract library, but it can be used to add custom information to your schema at design time which will later be evaluated by your own client or server-sided code. For example, CustomAttributes could be used to store additional display properties that will be evaluated by the client when displaying data.

property CustomAttributes: TStrings read write

DataType    (declared in TDABaseField)

Specifies the type of data contained within the field, from a collection of supported TDADataTypes. Depending on the data type, the Size and BlobType properties are also used to further define the data type in more detail. For datString and datWideString, Size will define the maximum length of string permitted for the field; for blobs and memos, BlobType provides special options.

property DataType: TDADataType read write

DecimalPrecision    (declared in TDABaseField)

Specifies decimal precision for a binary coded decimal value (if the DataType of the field is set to datDecimal).

property DecimalPrecision: Integer read write

DecimalScale    (declared in TDABaseField)

Specifies decimal scale for a binary coded decimal value (if the DataType of the field is set to datDecimal).

property DecimalScale: Integer read write

DefaultValue

Defines a default value to be written to the field when adding new records, client-side.

property DefaultValue: string read write

Description    (declared in TDABaseField)

Provides a human-readable description of the field. This property will not be used by the Data Abstract library, but can be filled with description text for documentation purposes when defining the field or parameter in Schema Modeler.

property Description: string read write

DictionaryEntry    (declared in TDABaseField)

Name of the data dictionary for the field

property DictionaryEntry: string read write

DisplayFormat

Sets the display format used for this field in visual data controls. Please refer to the Delphi documentation for TField and related classes for details on the syntax for formatting the field values.

property DisplayFormat: string read write

DisplayLabel

Specifies the display label or caption used for this field in visual data controls. By default, this value will be identical to the field's Name.

property DisplayLabel: string read write

DisplayWidth

Sets the display width, in characters, used for this field in visual data controls.

property DisplayWidth: Integer read write

EditFormat

Defines the editing format used for this field in visual data controls. Please refer to the Delphi documentation for TField and related classes for details on the syntax for formatting the field values.

property EditFormat: string read write

EditMask

This is the editing mask for this field in visual data controls. Please refer to the Delphi documentation for TField and related classes for details on the syntax for edit masks.

property EditMask: string read write

Expression

Pascal Script expression that is used for evaluating value of Calculated Fields with the help of TDAStdExpressionEvaluator

property Expression: string read write

FieldCollection

Returns the collection that this field belongs to. Typically, this will be the Fields property of the TDADataTable (if the field is part of a live data table) or schema TDADataset (if the field is part of a schema definition).

property FieldCollection: TDACustomFieldCollection read

GeneratorName    (declared in TDABaseField)

For fields of type datAutoInc, this property specifies the name of the generator in the back-end database that will be used to generate new primary key values. This applies only to database types that do not natively support AutoInc fields (such as Oracle or Interbase). Please refer to the AutoIncs and Generators help topic for more detail.

property GeneratorName: string read write

Ignored

Indicates that this field won't be fetched from DB server

property Ignored: Boolean read write

InPrimaryKey

Indicates whether this field is part of the primary key for the dataset. The primary key (or short PK) consists of the field or fields that uniquely identify each record in a dataset and, eventually, the underlying database table. Please refer to your database system's documentation and general database design guidelines for more information on primary keys.

property InPrimaryKey: Boolean read write

IsNull    (declared in TDABaseField)

Returns whether the field currently contains a value (false) or is Null (true).

property IsNull: Boolean read

KeyFields

Holds the key field or key fields that contain the original value to be looked up on the LookupSource.

property KeyFields: string read write

LogChanges

Decides whether changes to this field should be logged as part of the delta so they can layer be applied back to the server. When set to false, the client application will keep no record of changes made to these fields, and any changes made by client application will be lost when the client restarts or refreshes data from the server.

property LogChanges: Boolean read write

Lookup

Indicates whether the field is a Lookup Field, whose value will be determined at runtime by looking up values from a different dataset. Similar to calculated fields, lookup fields are not direct representations of a field in the back-end database, but are filled at runtime, usually by using a Foreign Key Relationship to look up values from a secondary table. For example, an Orders table might store a CustomerID field, and additionally have a CustomerName lookup field defined, which will be filled by obtaining the appropriate name (the LookupResultField) from the Customers table (the LookupSource), using the CustomerID (the LookupKeyFields).

property Lookup: Boolean read write

LookupCache

Toggles whether values for lookup fields will be cached (true) or reevaluated whenever they are needed. Set this property to true for optimal performance, if data in your lookup source changes rarely; set it to false to make sure your lookup values are always up to date if your data changes frequently.

property LookupCache: Boolean read write

LookupKeyFields

Specifies the key field or key fields that will be used on the LookupSource to locate the appropriate record.

property LookupKeyFields: string read write

LookupResultField

Sets of the name of the field (in the LookupSource) that contains the result value for the lookup. This field's value will be used as the value for the lookup field itself.

property LookupResultField: string read write

LookupSource

Defines the TDataSource that will used as the source to look up field values.

property LookupSource: TDataSource read write

Name    (declared in TDABaseField)

Defines the name of the field or parameter. This name usually matches the name of the underlying field in the physical database, or it's mapped to a different field using the data tables column mapping.

property Name: string read write

OldValue

Contains the original value of a changed field. If LogChanges is active for a field, the data table will maintain a log of all changes made to the records, until the changes are applied back to the back-end database. After a field's value has changed, this property will give you access to the original value that was obtained from the database. For obvious reasons, OldValue will not be available for newly inserted records.

property OldValue: Variant read

Private

Indicates that this field will be accessible on server-side only

property Private: Boolean read write

ReadOnly

Indicates whether the values contained in this field can be changed (false) or not.

property ReadOnly: Boolean read write

RegExpression

Sets a Regular Expression that will be used to validate values entered into this field. Any change that does not match the regular expression will be rejected.

property RegExpression: string read write

Required

Indicates whether the field requires a non-null value, or not. If set to true, data tables will not accept posting of new records or changes to existing records where this field does not contain a value. Note that the Required property merely enforces client-side data entry; it does not necessarily have to match "required" or "not null" settings on the back-end database (although in most scenarios the two will match). It is entirely possible to set a field as "required" although the back-end database in fact does allow nulls, or vice versa (although in the latter case, applying a null value to the back-end database will of course trigger the appropriate error from the database server).

property Required: Boolean read write

ServerAutoRefresh

Allows the value of this field to be automatically refreshed from the server as part of an INSERT or UPDATE. Set this value to true if you expect field values to change on the server when records are inserted or updated (for example due to default values or triggers), and you want your client to automatically receive the new value after the change has been processed. If this value is true, the server will generate a new delta record after processing the change, to allow the values to be sent back to the client and merged into the local client-side data table. This behavior is comparable to AutoInc values, which will also automatically be sent back to the client after inserts. See the AutoIncs and Generators help topic for more details. For AutoIncs, server refresh on insert is implicit, and this property does not need to be set to true.

property ServerAutoRefresh: Boolean read write

ServerCalculated

Indicates that value for the field is calculated on the server (either with database trigger or in OnWriteFieldValue event handler of data streamer).

property ServerCalculated: Boolean read write

Size    (declared in TDABaseField)

Sets the maximum length of string permitted for the field, DataType is set to datString or datWideString.

property Size: Integer read write

SQLOrigin

The name of the field returned from data table query (which will be identical to the TableField in most cases, unless your SQL query uses the AS directive to change field names). Used in Column Mappings

property SQLOrigin: string read write

TableField

The name of the field in the back-end database. Used in Column Mappings

property TableField: string read write

Tag    (declared in TDABaseField)

Tag has no predefined meaning. The Tag property can store any additional integer value for the convenience of developers

property Tag: Integer read write

Value    (declared in TDABaseField)

Gets or sets the value of the field as variant.

property Value: Variant read write

Visible

Toggles whether this field should be visible by default in grids and other data-bound controls (true) or not (false). Note that this property only controls the default visibility for "unconfigured" grids and data controls. Individual settings on user controls can override the visibility.

property Visible: Boolean read write

 

constructor Create  override

Creates a new instance.

constructor Create(Collection: TCollection)

Parameters:

  • Collection: collection which the field belongs to

Assign  override

Assigns the Source field.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AssignField  override

Assigns the Source field

procedure AssignField(Source: TDABaseField)

Parameters:


Bind (IDANativeField)  overload

Sets IDANativeField member properties of the class in the case of using non-dataset compatible driver. Used for internal operations.

procedure Bind(aField: IDANativeField)

Parameters:

  • aField: this parameter implemented by non-dataset compatible driver, to which TDACustomField should be bounded to.

Bind (TField)  overload

Sets internal TField member of the class. Used for internal operations only such as for initializing data table process, opening clone cursors, etc.

procedure Bind(aField: TField)

Parameters:

  • aField: TField instance to which current field should be bind to

Clear    (declared in TDABaseField)

Clears the value of the field by setting it to Null.

procedure Clear

FocusControl

Forces a form's focus to the first data-aware component associated with the field object.

procedure FocusControl

GetDisplayName  protected override    (declared in TDABaseField)

Returns Name of the field

function GetDisplayName: string

GetIsNull  protected override

Returns whether the field currently contains a value (false) or is Null (true).

function GetIsNull: Boolean

GetNamePath  override

Returns the name of the object as it appears in the Object Inspector

function GetNamePath: string

GetOwner  protected override

Returns collection which the field belongs to

function GetOwner: TPersistent

HasValidDictionaryField  override

Indicates if the field has appropriate data dictionary entry

function HasValidDictionaryField: Boolean

IsCompatibleV4  protected override

Specifies DA4 compatible mode.

function IsCompatibleV4: Boolean

LoadFromFile

Loads BLOB data from a file into the field, if DataType of the field is datBlob

procedure LoadFromFile(const aFileName: string)

Parameters:

  • aFileName: the name of the file to load into the field

LoadFromStream (IROStream)  overload

Loads BLOB data from a IROStream's underlying stream into the field, if DataType of the field is datBlob

procedure LoadFromStream(const aStream: IROStream)

Parameters:

  • aStream: stream from where field should be loaded

LoadFromStream (TStream)  overload

Loads BLOB data from a stream into the field, if DataType of the field is datBlob

procedure LoadFromStream(const aStream: TStream)

Parameters:

  • aStream: stream from where field should be loaded

MergeDatadictionaries  protected override

One of the conditions for indicating if the field's property should be saved on the form or when TDASchema is saved. For internal using.

function MergeDatadictionaries: Boolean

QueryInterface  protected stdcall    (declared in TInterfacedCollectionItem)

Returns a reference to a specified interface if the object supports that interface. This is one of the methods introduced by the IUnknown interface.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: Variable to store the returned interface reference to

SaveToFile

Saves the contents of the BLOB field to a file, if DataType of the field is datBlob

procedure SaveToFile(const aFileName: string)

Parameters:

  • aFileName: the name of the file where field content should be saved to

SaveToStream (IROStream)  overload

Saves the contents of the BLOB field to a IROStream's underlying stream

procedure SaveToStream(const aStream: IROStream)

Parameters:

  • aStream: stream where field content should be saved to

SaveToStream (TStream)  overload

Saves the contents of the BLOB field to a stream

procedure SaveToStream(const aStream: TStream)

Parameters:

  • aStream: stream where field content should be saved to

SetAsAnsiString  protected override

Sets the value of the field as 8-bit ANSI string value.

procedure SetAsAnsiString(const aValue: string)

Parameters:

  • aValue: the value for the field that should be set

SetDisplayName  protected override    (declared in TDABaseField)

Sets the name of the field as it appears in the collection editor.

procedure SetDisplayName(const Value: string)

Parameters:

  • Value: value for the Name property

SetValue  protected override

Sets the value for the field taking into account data type of the Value

procedure SetValue(const Value: Variant)

Parameters:

  • Value:

StoreBlobType  protected    (declared in TDABaseField)

Indicates if original field's BlobType property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreBlobType: Boolean

StoreDataType  protected    (declared in TDABaseField)

Indicates if field's DataType property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now.

function StoreDataType: Boolean

StoreDecimalPrecision  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema.

function StoreDecimalPrecision: Boolean

StoreDecimalScale  protected    (declared in TDABaseField)

Indicates if field's DecimalScale property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema.

function StoreDecimalScale: Boolean

StoreDescription  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreDescription: Boolean

StoreGeneratorName  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreGeneratorName: Boolean

StoreSize  protected    (declared in TDABaseField)

Indicates if field's DecimalPrecision property (not appropriate data dictionary property) should be saved in the form file or when saving TDASchema. Not used for now

function StoreSize: Boolean

Unbind

Sets all the event handlers of TField member and himself to nil

procedure Unbind

 

OnChange

Fires whenever the value of a particular field has been changed.

property OnChange: TDAFieldNotifyEvent read write
delegate: procedure OnChange(Sender: TDACustomField)

OnGetText

Occurs when the DisplayText or Text property of the field is referenced.

property OnGetText: TDAFieldGetTextEvent read write
delegate: procedure OnGetText(Sender: TDACustomField; var Text: string; DisplayText: Boolean)

OnSetText

Occurs when the Text property is assigned a value.

property OnSetText: TDAFieldSetTextEvent read write
delegate: procedure OnSetText(Sender: TDACustomField; const Text: string)

OnValidate

Fires whenever the value of a particular field is about to change, given the event handler opportunity to validate and possibly reject the change by raising an exception.

property OnValidate: TDAFieldNotifyEvent read write
delegate: procedure OnValidate(Sender: TDACustomField)