TDADataTableRules

Overview

The TDADataTableRules class represents a collection of Business Rules (see more in Business Rules in Depth) for custom strongly typed data tables.

The TDADataTableRules class provides the implementation of the event handlers (i.e. BeforePost, AfterInsert, etc.). You do not need to use this class directly, but you can use the descendants of this class while setting specified Business Rules for custom strongly typed data tables. The descendants of the TDADataTableRules class provide specified business logic for custom data tables.

For example: After creating a strongly typed data table with the menu option "Generate SampleSchema strongly-typed access units", the strongly typed data table ancestor and descendant classes will have the following structure (the code was taken from the DataAbstract example "Strongly Typed"):

  TCustomersDataTableRules = class(TDADataTableRules, ICustomers)
  private
  protected
    { Property getters and setters }
    ...
    procedure SetFaxValue(const aValue: String); virtual;
    function GetFaxIsNull: Boolean; virtual;
    procedure SetFaxIsNull(const aValue: Boolean); virtual;

    { Properties }
    property CustomerID: String read GetCustomerIDValue write SetCustomerIDValue;
    property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull;
    property CompanyName: String read GetCompanyNameValue write SetCompanyNameValue;
    ...
  end;

  TBizCustomersClientRules = class(TCustomersDataTableRules, IAdvancedCustomer)
  protected
    // Business events
    procedure AfterInsert(Sender : TDADataTable); override;
    ...
  end;

  procedure TBizCustomersClientRules.AfterInsert(Sender : TDADataTable);
  begin
    inherited;
    CustomerID := IntToStr(DataTable.RecordCount);
    CompanyName := def_CompanyName;
    ContactName := def_ContactName;
  end;

Location


 

constructor Create  virtual    (declared in TDABusinessRules)

Creates a new instance.

constructor Create

constructor Create (TDADataTable)  reintroduce virtual

Creates a new instance. If aDataTable is not assigned, an exception is raised.

constructor Create(aDataTable: TDADataTable)

Parameters:

  • aDataTable: Specified input data table

Active  protected

Determines if the specified strongly typed data table is active (value true) or not (value false).

property Active: Boolean read write

AfterCancel  protected virtual

Protected virtual procedure that represents the event that occurs after an application completes a request to cancel modifications to the active record.

procedure AfterCancel(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterClose  protected virtual

Protected virtual procedure that represents the event that occurs after an application closes a data table.

procedure AfterClose(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterDelete  protected virtual

Protected virtual procedure that represents the event that occurs after an application deletes an active record.

procedure AfterDelete(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterEdit  protected virtual

Protected virtual procedure that represents the event that occurs after an application starts editing a record.

procedure AfterEdit(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterInsert  protected virtual

Protected virtual procedure that represents the event that occurs after an application inserts a new record.

procedure AfterInsert(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterOpen  protected virtual

Protected virtual procedure that represents the event that occurs after an application completes opening a data table and before any data access occurs.

procedure AfterOpen(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterPost  protected virtual

Protected virtual procedure that represents the event that occurs after an application writes the active record to the database or changes the log and returns to browse state.

procedure AfterPost(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterRefresh  protected virtual

Protected virtual procedure that represents the event that occurs after an application refreshes the data in the data table.

procedure AfterRefresh(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterScroll  protected virtual

Protected virtual procedure that represents the event that occurs after an application scrolls from one record to another.

procedure AfterScroll(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

Append  protected virtual

Protected virtual procedure that adds a new empty record to the end of the data table.

procedure Append

ApplyRange  protected safecall

Applies a range of records to the data table. Only those records that fall within the range should be available in the application for viewing and editing.

The ApplyRange procedure will not take effect until the SetRangeStart and SetRangeEnd procedures, or the EditRangeStart and EditRangeEnd procedures have been called.

procedure ApplyRange

Attach  protected virtual

Calls the RefreshDetails procedure that gets the detail data tables of the DataTable and associates them with the Details collection. This procedure is protected and virtual.

procedure Attach(aDataTable: TDADataTable)

Parameters:

  • aDataTable: Specified data table that should be attached

BeforeCancel  protected virtual

Protected virtual procedure that represents the event that occurs before an application executes a request to cancel changes to the active record.

procedure BeforeCancel(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeClose  protected virtual

Protected virtual procedure that represents the event that occurs immediately before the data table closes.

procedure BeforeClose(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeDelete  protected virtual

Protected virtual procedure that represents the event that occurs before an application attempts to delete the active record.

procedure BeforeDelete(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeEdit  protected virtual

Protected virtual procedure that represents the event that occurs before an application attempts to delete the active record.

procedure BeforeEdit(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeInsert  protected virtual

Protected virtual procedure that represents the event that occurs before an application enters insert mode.

procedure BeforeInsert(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeOpen  protected virtual

Protected virtual procedure that represents the event that occurs before an application executes a request to open a data table.

procedure BeforeOpen(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforePost  protected virtual

Protected virtual procedure that represents the event that occurs before an application posts changes for the active record to the database or change log.

procedure BeforePost(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeRefresh  protected virtual

Protected virtual procedure that represents the event that occurs immediately before an application refreshes the data in the data table.

procedure BeforeRefresh(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeScroll  protected virtual

Protected virtual procedure that represents the event that occurs before an application scrolls from one record to another.

procedure BeforeScroll(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

Cancel  protected virtual

Protected virtual procedure that cancels modifications to the active record if those changes are not yet posted.

procedure Cancel

CancelRange  protected safecall

Removes any ranges currently in effect for the current data table.

procedure CancelRange

ClearField  protected

Clears the specified data table field.

procedure ClearField(const FieldIndexOrName: Variant)

Parameters:

  • FieldIndexOrName: Input index or field name that will be cleared

Close  protected virtual

Protected virtual procedure that closes the current data table.

procedure Close

DataTable  protected

Represents the data table that is related with the current data table rules. This property is read-only.

property DataTable: TDADataTable read

Delete  protected virtual

Protected virtual procedure that deletes the active record and positions the dataset on the next record.

procedure Delete

Detach  protected virtual

Protected virtual procedure that clears the collection of detail tables.

procedure Detach(aDataTable: TDADataTable)

Parameters:

  • aDataTable: Specified data table that should be detached

DetailByName  protected

Gets the detail data table with the specified name.

function DetailByName(const aLogicalName: string): TDADataTable

Parameters:

  • aLogicalName: Specified detail data table name

DetailCount  protected

Represents the count of detail tables that are related with the current data table (DataTableproperty). This property is read-only.

property DetailCount: Integer read

Details  protected

Gets the detail table with the specified index from the collection of detail tables.

property Details[Index: Integer]: TDADataTable read

Edit  protected virtual

Protected virtual procedure that enables the editing of data in the data table.

procedure Edit

EditRangeEnd  protected safecall

Enables the changing of the ending value for an existing range. After assigning a new ending value, the ApplyRange procedure is called to activate the modified range.

procedure EditRangeEnd

EditRangeStart  protected safecall

Enables the changing of the starting value for an existing range. After assigning a new ending value, the ApplyRange procedure is called to activate the modified range.

procedure EditRangeStart

FindDetail  protected

Gets the detail table with the specified name.

function FindDetail(const aLogicalName: string): TDADataTable

Parameters:

  • aLogicalName: Specified detail table name

First  protected virtual

Moves to the first record in the data table.

procedure First

GetActive  protected

Gets the state of the data table. If the result equals true, the data table is in active state, if it equals false, the data table is inactive.

function GetActive: Boolean

GetBOF  protected virtual

Protected virtual function that returns true if the first record in the data table is active at the moment, otherwise it returns false.

function GetBOF: Boolean

GetDataTable  protected

Gets the data table that is related with the current data table rules.

function GetDataTable: TDADataTable

GetDetailOptions  protected

Returns the detail table options that are related with the current data table.

function GetDetailOptions: TDADetailOptions

GetEOF  protected virtual

Protected virtual function that returns true if the last record is active in the data table at the moment, otherwise - returns false.

function GetEOF: Boolean

GetMasterOptions  protected

Returns master table options that are related with current data table.

function GetMasterOptions: TDAMasterOptions

GetRecNo  protected

Returns the active record number in the current data table.

function GetRecNo: Integer

GetRecordCount  protected virtual

Protected virtual function that returns the count of records in the current data table.

function GetRecordCount: Integer

Insert  protected virtual

Protected virtual procedure that inserts a new empty record into the date table.

procedure Insert

IsEmpty  protected

Checks whether the date table is empty (true) or not (false).

property IsEmpty: Boolean read

IsFieldNull  protected

Protected function that returns true if the specified field of the active record has NULL value, otherwise it returns false.

function IsFieldNull(const FieldIndexOrName: Variant): Boolean

Parameters:

  • FieldIndexOrName: Specified field index or field name

Last  protected virtual

Moves to the last record in the data table.

procedure Last

Locate  protected virtual

Searches a dataset for a specified record, makes it the active record and returns true if a record is found that matches the specified criteria and that record is now active, otherwise it returns false.

function Locate(const aKeyFields: string; const aKeyValues: Variant; aOptions: TLocateOptions): Boolean

Parameters:

  • aKeyFields: Input field or fields that should be matched in the dataset when doing a locate.
  • aKeyValues: Input field values that should be matched in the dataset when doing a locate.
  • aOptions: Options that are used during locating. Can have the following values: loCaseInsensitive or loPartialKey. By default, the value is empty.

Lookup  protected

Retrieves field values from the record that match the specified search values and returns a variant or a variant array that contains the value or values of the fields specified by a comma-delimited string ResultField on the specified record.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: Input field or fields that should be matched in the dataset when doing a lookup.
  • KeyValues: Input field values that should be matched in the dataset when doing a lookup.
  • ResultFields: Result field collection that will include the output result set.

Moves the next record in the current data table.

procedure Next

OnAfterApplyUpdates  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished applying updates to the server.

procedure OnAfterApplyUpdates(DataTable: TDADataTable)

Parameters:

  • DataTable: Specified input data table

OnAfterDataRequestCall  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished a data request call to the server.

procedure OnAfterDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnAfterDataUpdateCall  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished a data update call to the server.

procedure OnAfterDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnAfterMergeDelta  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished merging deltas received from the server.

procedure OnAfterMergeDelta(DataTable: TDADataTable)

Parameters:

  • DataTable: Specified input data table

OnAfterSchemaCall  protected virtual

Protected virtual procedure that represents the event that fires right after the Schema has finished called.

procedure OnAfterSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnAfterScriptCall  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished a script call to the server.

procedure OnAfterScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeApplyUpdates  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts applying updates to the server.

procedure OnBeforeApplyUpdates(DataTable: TDADataTable; const Delta: IDADelta)

Parameters:

  • DataTable: Specified input data table
  • Delta: Specified input delta

OnBeforeDataRequestCall  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts a data update call to the server.

procedure OnBeforeDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeDataUpdateCall  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts a data update call to the server.

procedure OnBeforeDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeMergeDelta  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts merging deltas received from the server.

procedure OnBeforeMergeDelta(DataTable: TDADataTable)

Parameters:

  • DataTable: Specified input data table

OnBeforeSchemaCall  protected virtual

Protected virtual procedure that represents the event that fires right before the Schema is called.

procedure OnBeforeSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeScriptCall  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts a script call to the server.

procedure OnBeforeScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnCalcFields  protected virtual

Protected virtual procedure that represents the event that occurs when an application recalculates calculated fields.

procedure OnCalcFields(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

OnDeleteError  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to delete a record and an exception is raised.

procedure OnDeleteError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

Parameters:

  • DataTable: Specified input data table
  • Error: Specified exception class for database errors
  • Action: Type of parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits.

OnEditError  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to modify or insert a record and an exception is raised.

procedure OnEditError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

Parameters:

  • DataTable: Specified input data table
  • Error: Specified exception class for database errors
  • Action: Type of parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits.

OnFilterRecord  protected virtual

Protected virtual procedure that represents the event that occurs each time a different record in the dataset becomes the active record and filtering is enabled.

procedure OnFilterRecord(DataTable: TDADataTable; var Accept: Boolean)

Parameters:

  • DataTable: Specified input data table
  • Accept: True indicates that a record passes the filter condition, false excludes the record.

OnNewRecord  protected virtual

Protected virtual procedure that represents the event that occurs when an application inserts or appends a new dataset record.

procedure OnNewRecord(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

OnPostError  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to modify or insert a record and an exception is raised.

procedure OnPostError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

Parameters:

  • DataTable: Specified input data table
  • Error: Specified exception class for database errors
  • Action: Type of parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits.

OnReceiveDataStream  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to receive the input data stream.

procedure OnReceiveDataStream(DataTable: TDADataTable; Stream: TStream)

Parameters:

  • DataTable: Specified data table
  • Stream: Specified input data stream

Open  protected virtual

Opens the data table and prepares it for fetching records from the database. If the datatable is not empty, the cursor will be placed on the first available record; otherwise, EOF will be set to true to indicate that the end of the (empty) record set has been reached.

procedure Open

Post  protected virtual

Posts modified records to the related database.

procedure Post

Prior  protected virtual

Moves to the previous record in the data table.

procedure Prior

RefreshDetails  protected

Gets the detail data tables of the DataTable and associates them with the Details collection.

procedure RefreshDetails

SetActive  protected

Sets the new state of the data table: true if the data table should be active, false if the data table should not be active.

procedure SetActive(const Value: Boolean)

Parameters:

  • Value: Specified new state of the data table

SetDetailOptions  protected

Sets the options that are related with the current detail table.

procedure SetDetailOptions(Value: TDADetailOptions)

Parameters:

  • Value: Specified input detail options

SetMasterOptions  protected

Sets the options that are related with the current master table.

procedure SetMasterOptions(Value: TDAMasterOptions)

Parameters:

  • Value: Specified input master options

SetRange  protected safecall

Sets the starting and ending values of a range and applies it to the specified dataset.

procedure SetRange(const StartValues: array of const; const EndValues: array of const)

Parameters:

  • StartValues: Field values that represent the first record in the range
  • EndValues: Field values that represent the last record in the range

SetRangeEnd  protected safecall

Indicates that subsequent assignments to field values specify the end of the range of rows to include in the dataset.
After assigning end-range values, the ApplyRange procedure is called to activate the modified range.

procedure SetRangeEnd

SetRangeStart  protected safecall

Indicates that subsequent assignments to field values specify the start of the range of rows to include in the dataset.
After assigning start-range values, the ApplyRange procedure is called to activate the modified range.

procedure SetRangeStart

SetRecNo  protected

Sets the number of active records in the current data table.

procedure SetRecNo(Value: Integer)

Parameters:

  • Value: Input number of active record

State  protected

Gets the state of the data table. This property can have the following values: dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue, dsBlockRead, dsInternalCalc or dsOpening.

property State: TDatasetState read

 

Active  protected

Determines if the specified strongly typed data table is active (value true) or not (value false).

property Active: Boolean read write

DataTable  protected

Represents the data table that is related with the current data table rules. This property is read-only.

property DataTable: TDADataTable read

DetailCount  protected

Represents the count of detail tables that are related with the current data table (DataTableproperty). This property is read-only.

property DetailCount: Integer read

Details  protected

Gets the detail table with the specified index from the collection of detail tables.

property Details[Index: Integer]: TDADataTable read

IsEmpty  protected

Checks whether the date table is empty (true) or not (false).

property IsEmpty: Boolean read

State  protected

Gets the state of the data table. This property can have the following values: dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue, dsBlockRead, dsInternalCalc or dsOpening.

property State: TDatasetState read

 

constructor Create  virtual    (declared in TDABusinessRules)

Creates a new instance.

constructor Create

constructor Create (TDADataTable)  reintroduce virtual

Creates a new instance. If aDataTable is not assigned, an exception is raised.

constructor Create(aDataTable: TDADataTable)

Parameters:

  • aDataTable: Specified input data table

AfterCancel  protected virtual

Protected virtual procedure that represents the event that occurs after an application completes a request to cancel modifications to the active record.

procedure AfterCancel(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterClose  protected virtual

Protected virtual procedure that represents the event that occurs after an application closes a data table.

procedure AfterClose(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterDelete  protected virtual

Protected virtual procedure that represents the event that occurs after an application deletes an active record.

procedure AfterDelete(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterEdit  protected virtual

Protected virtual procedure that represents the event that occurs after an application starts editing a record.

procedure AfterEdit(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterInsert  protected virtual

Protected virtual procedure that represents the event that occurs after an application inserts a new record.

procedure AfterInsert(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterOpen  protected virtual

Protected virtual procedure that represents the event that occurs after an application completes opening a data table and before any data access occurs.

procedure AfterOpen(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterPost  protected virtual

Protected virtual procedure that represents the event that occurs after an application writes the active record to the database or changes the log and returns to browse state.

procedure AfterPost(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterRefresh  protected virtual

Protected virtual procedure that represents the event that occurs after an application refreshes the data in the data table.

procedure AfterRefresh(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

AfterScroll  protected virtual

Protected virtual procedure that represents the event that occurs after an application scrolls from one record to another.

procedure AfterScroll(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

Append  protected virtual

Protected virtual procedure that adds a new empty record to the end of the data table.

procedure Append

ApplyRange  protected safecall

Applies a range of records to the data table. Only those records that fall within the range should be available in the application for viewing and editing.

The ApplyRange procedure will not take effect until the SetRangeStart and SetRangeEnd procedures, or the EditRangeStart and EditRangeEnd procedures have been called.

procedure ApplyRange

Attach  protected virtual

Calls the RefreshDetails procedure that gets the detail data tables of the DataTable and associates them with the Details collection. This procedure is protected and virtual.

procedure Attach(aDataTable: TDADataTable)

Parameters:

  • aDataTable: Specified data table that should be attached

BeforeCancel  protected virtual

Protected virtual procedure that represents the event that occurs before an application executes a request to cancel changes to the active record.

procedure BeforeCancel(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeClose  protected virtual

Protected virtual procedure that represents the event that occurs immediately before the data table closes.

procedure BeforeClose(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeDelete  protected virtual

Protected virtual procedure that represents the event that occurs before an application attempts to delete the active record.

procedure BeforeDelete(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeEdit  protected virtual

Protected virtual procedure that represents the event that occurs before an application attempts to delete the active record.

procedure BeforeEdit(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeInsert  protected virtual

Protected virtual procedure that represents the event that occurs before an application enters insert mode.

procedure BeforeInsert(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeOpen  protected virtual

Protected virtual procedure that represents the event that occurs before an application executes a request to open a data table.

procedure BeforeOpen(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforePost  protected virtual

Protected virtual procedure that represents the event that occurs before an application posts changes for the active record to the database or change log.

procedure BeforePost(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeRefresh  protected virtual

Protected virtual procedure that represents the event that occurs immediately before an application refreshes the data in the data table.

procedure BeforeRefresh(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

BeforeScroll  protected virtual

Protected virtual procedure that represents the event that occurs before an application scrolls from one record to another.

procedure BeforeScroll(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

Cancel  protected virtual

Protected virtual procedure that cancels modifications to the active record if those changes are not yet posted.

procedure Cancel

CancelRange  protected safecall

Removes any ranges currently in effect for the current data table.

procedure CancelRange

ClearField  protected

Clears the specified data table field.

procedure ClearField(const FieldIndexOrName: Variant)

Parameters:

  • FieldIndexOrName: Input index or field name that will be cleared

Close  protected virtual

Protected virtual procedure that closes the current data table.

procedure Close

Delete  protected virtual

Protected virtual procedure that deletes the active record and positions the dataset on the next record.

procedure Delete

Detach  protected virtual

Protected virtual procedure that clears the collection of detail tables.

procedure Detach(aDataTable: TDADataTable)

Parameters:

  • aDataTable: Specified data table that should be detached

DetailByName  protected

Gets the detail data table with the specified name.

function DetailByName(const aLogicalName: string): TDADataTable

Parameters:

  • aLogicalName: Specified detail data table name

Edit  protected virtual

Protected virtual procedure that enables the editing of data in the data table.

procedure Edit

EditRangeEnd  protected safecall

Enables the changing of the ending value for an existing range. After assigning a new ending value, the ApplyRange procedure is called to activate the modified range.

procedure EditRangeEnd

EditRangeStart  protected safecall

Enables the changing of the starting value for an existing range. After assigning a new ending value, the ApplyRange procedure is called to activate the modified range.

procedure EditRangeStart

FindDetail  protected

Gets the detail table with the specified name.

function FindDetail(const aLogicalName: string): TDADataTable

Parameters:

  • aLogicalName: Specified detail table name

First  protected virtual

Moves to the first record in the data table.

procedure First

GetActive  protected

Gets the state of the data table. If the result equals true, the data table is in active state, if it equals false, the data table is inactive.

function GetActive: Boolean

GetBOF  protected virtual

Protected virtual function that returns true if the first record in the data table is active at the moment, otherwise it returns false.

function GetBOF: Boolean

GetDataTable  protected

Gets the data table that is related with the current data table rules.

function GetDataTable: TDADataTable

GetDetailOptions  protected

Returns the detail table options that are related with the current data table.

function GetDetailOptions: TDADetailOptions

GetEOF  protected virtual

Protected virtual function that returns true if the last record is active in the data table at the moment, otherwise - returns false.

function GetEOF: Boolean

GetMasterOptions  protected

Returns master table options that are related with current data table.

function GetMasterOptions: TDAMasterOptions

GetRecNo  protected

Returns the active record number in the current data table.

function GetRecNo: Integer

GetRecordCount  protected virtual

Protected virtual function that returns the count of records in the current data table.

function GetRecordCount: Integer

Insert  protected virtual

Protected virtual procedure that inserts a new empty record into the date table.

procedure Insert

IsFieldNull  protected

Protected function that returns true if the specified field of the active record has NULL value, otherwise it returns false.

function IsFieldNull(const FieldIndexOrName: Variant): Boolean

Parameters:

  • FieldIndexOrName: Specified field index or field name

Last  protected virtual

Moves to the last record in the data table.

procedure Last

Locate  protected virtual

Searches a dataset for a specified record, makes it the active record and returns true if a record is found that matches the specified criteria and that record is now active, otherwise it returns false.

function Locate(const aKeyFields: string; const aKeyValues: Variant; aOptions: TLocateOptions): Boolean

Parameters:

  • aKeyFields: Input field or fields that should be matched in the dataset when doing a locate.
  • aKeyValues: Input field values that should be matched in the dataset when doing a locate.
  • aOptions: Options that are used during locating. Can have the following values: loCaseInsensitive or loPartialKey. By default, the value is empty.

Lookup  protected

Retrieves field values from the record that match the specified search values and returns a variant or a variant array that contains the value or values of the fields specified by a comma-delimited string ResultField on the specified record.

function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant

Parameters:

  • KeyFields: Input field or fields that should be matched in the dataset when doing a lookup.
  • KeyValues: Input field values that should be matched in the dataset when doing a lookup.
  • ResultFields: Result field collection that will include the output result set.

Moves the next record in the current data table.

procedure Next

OnAfterApplyUpdates  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished applying updates to the server.

procedure OnAfterApplyUpdates(DataTable: TDADataTable)

Parameters:

  • DataTable: Specified input data table

OnAfterDataRequestCall  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished a data request call to the server.

procedure OnAfterDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnAfterDataUpdateCall  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished a data update call to the server.

procedure OnAfterDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnAfterMergeDelta  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished merging deltas received from the server.

procedure OnAfterMergeDelta(DataTable: TDADataTable)

Parameters:

  • DataTable: Specified input data table

OnAfterSchemaCall  protected virtual

Protected virtual procedure that represents the event that fires right after the Schema has finished called.

procedure OnAfterSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnAfterScriptCall  protected virtual

Protected virtual procedure that represents the event that fires right after the data table has finished a script call to the server.

procedure OnAfterScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeApplyUpdates  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts applying updates to the server.

procedure OnBeforeApplyUpdates(DataTable: TDADataTable; const Delta: IDADelta)

Parameters:

  • DataTable: Specified input data table
  • Delta: Specified input delta

OnBeforeDataRequestCall  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts a data update call to the server.

procedure OnBeforeDataRequestCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeDataUpdateCall  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts a data update call to the server.

procedure OnBeforeDataUpdateCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeMergeDelta  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts merging deltas received from the server.

procedure OnBeforeMergeDelta(DataTable: TDADataTable)

Parameters:

  • DataTable: Specified input data table

OnBeforeSchemaCall  protected virtual

Protected virtual procedure that represents the event that fires right before the Schema is called.

procedure OnBeforeSchemaCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnBeforeScriptCall  protected virtual

Protected virtual procedure that represents the event that fires just before the data table starts a script call to the server.

procedure OnBeforeScriptCall(DataTable: TDADataTable; Request: TDARemoteRequest)

Parameters:

  • DataTable: Specified input data table
  • Request: Specified data request

OnCalcFields  protected virtual

Protected virtual procedure that represents the event that occurs when an application recalculates calculated fields.

procedure OnCalcFields(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

OnDeleteError  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to delete a record and an exception is raised.

procedure OnDeleteError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

Parameters:

  • DataTable: Specified input data table
  • Error: Specified exception class for database errors
  • Action: Type of parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits.

OnEditError  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to modify or insert a record and an exception is raised.

procedure OnEditError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

Parameters:

  • DataTable: Specified input data table
  • Error: Specified exception class for database errors
  • Action: Type of parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits.

OnFilterRecord  protected virtual

Protected virtual procedure that represents the event that occurs each time a different record in the dataset becomes the active record and filtering is enabled.

procedure OnFilterRecord(DataTable: TDADataTable; var Accept: Boolean)

Parameters:

  • DataTable: Specified input data table
  • Accept: True indicates that a record passes the filter condition, false excludes the record.

OnNewRecord  protected virtual

Protected virtual procedure that represents the event that occurs when an application inserts or appends a new dataset record.

procedure OnNewRecord(Sender: TDADataTable)

Parameters:

  • Sender: Sender of this event

OnPostError  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to modify or insert a record and an exception is raised.

procedure OnPostError(DataTable: TDADataTable; Error: EDatabaseError; var Action: TDataAction)

Parameters:

  • DataTable: Specified input data table
  • Error: Specified exception class for database errors
  • Action: Type of parameter in certain dataset event handlers that indicates how the dataset should proceed after the event handler exits.

OnReceiveDataStream  protected virtual

Protected virtual procedure that represents the event that occurs when an application attempts to receive the input data stream.

procedure OnReceiveDataStream(DataTable: TDADataTable; Stream: TStream)

Parameters:

  • DataTable: Specified data table
  • Stream: Specified input data stream

Open  protected virtual

Opens the data table and prepares it for fetching records from the database. If the datatable is not empty, the cursor will be placed on the first available record; otherwise, EOF will be set to true to indicate that the end of the (empty) record set has been reached.

procedure Open

Post  protected virtual

Posts modified records to the related database.

procedure Post

Prior  protected virtual

Moves to the previous record in the data table.

procedure Prior

RefreshDetails  protected

Gets the detail data tables of the DataTable and associates them with the Details collection.

procedure RefreshDetails

SetActive  protected

Sets the new state of the data table: true if the data table should be active, false if the data table should not be active.

procedure SetActive(const Value: Boolean)

Parameters:

  • Value: Specified new state of the data table

SetDetailOptions  protected

Sets the options that are related with the current detail table.

procedure SetDetailOptions(Value: TDADetailOptions)

Parameters:

  • Value: Specified input detail options

SetMasterOptions  protected

Sets the options that are related with the current master table.

procedure SetMasterOptions(Value: TDAMasterOptions)

Parameters:

  • Value: Specified input master options

SetRange  protected safecall

Sets the starting and ending values of a range and applies it to the specified dataset.

procedure SetRange(const StartValues: array of const; const EndValues: array of const)

Parameters:

  • StartValues: Field values that represent the first record in the range
  • EndValues: Field values that represent the last record in the range

SetRangeEnd  protected safecall

Indicates that subsequent assignments to field values specify the end of the range of rows to include in the dataset.
After assigning end-range values, the ApplyRange procedure is called to activate the modified range.

procedure SetRangeEnd

SetRangeStart  protected safecall

Indicates that subsequent assignments to field values specify the start of the range of rows to include in the dataset.
After assigning start-range values, the ApplyRange procedure is called to activate the modified range.

procedure SetRangeStart

SetRecNo  protected

Sets the number of active records in the current data table.

procedure SetRecNo(Value: Integer)

Parameters:

  • Value: Input number of active record