Current Time Status Tables

Sep 23, 2024

Valid Time State Tables

Definition

  • Valid Time State Tables: In English, "Date Control Table".
  • A feature that automatically manages start and end dates.
  • Provides a framework that does not require users to constantly update dates.

Table Creation Process

  • ValidTimeState DMR Tables: Used when creating tables.
  • Field Type Selection:
    • Date: Adds Start Date and End Date.
    • DateTime: Adds Start Date Time and End Date Time.

Added Fields

  • Date ID: A 10-character string.
  • Name: A 60-character string.
  • valid from and valid to fields are automatically added.

Index Definition

  • DateIDX Index:
    • Includes DateID and must be unique.
    • Must be marked as Alternative key and valid time state key.

Gap and No Gap Options

  • Gap: Used if gaps are allowed.
    • Example: Failure to renew a contract.
  • No Gap: Ensures continuous records.
    • Example: Change of employee position.

Table Features

  • Primary Index and Cluster Index: Remain as Surrogate Key.
  • Replacement Key: An alternative key created in the Valid Time State type.

Form Creation

  • Data Source: The Valid Time State table is added.
  • Grid: Date ID, Valid From and Valid To fields are added.
  • Active Records: It is possible to view active records on the form.

Record Adding Operations

  • When a new record is added, the end date of the previous record is automatically updated.
  • The framework automatically manages date operations.

Operations in Code

  • Select Operations: Performed on tables using Valid Time State.
    • It is mandatory to specify valid time state in While Select and Select when fetching records.
  • Range Queries: Queries can be made between date ranges.

Query Usage

  • Object Oriented Select: Can query by adding a data source.
  • Different date functions can be used with ValidTimeState.

Resources and Documentation

  • White Paper: A resource that details the features of Valid Time State tables.
  • Application Areas: Widely used in areas like human resources.

Conclusion

  • The Valid Time State feature provides great convenience in date-based data management.
  • It is recommended to use these structures when needed.