IRdsAttribute.TimeDependent

Fore Syntax

TimeDependent: Boolean;

Fore.NET Syntax

TimeDependent: boolean;

Description

The TimeDependent property determines whether time component for attributes with the DateTime type is considered.

Comment

Available values:

For system attributes INDATE and OUTDATE this property is set to False by default, if the property for these attributes is set to True, time is considered in valid periods of elements.

The attribute data type is determined with the IRdsAttribute.DataType property.

Fore Example

Executing the example requires that the repository contains an MDM repository with the MDM identifier containing an MDM dictionary with the DICT identifier.

Add links to the Dal, Metabase and Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dict: IRdsDictionary;
    Attrs: IRdsAttributes;
    Attr: IRdsAttribute;
Begin
    MB := MetabaseClass.Active;
    // Get MDM dictionary
    MObj := MB.ItemByIdNamespace("DICT", MB.ItemById("MDM").Key).Edit;
    Dict := MObj As IRdsDictionary;
    // Get dictionary attributes
    Attrs := Dict.Attributes;
    // Add new attribute
    Attr := Attrs.Add;
    // Set attribute data type: date and time
    Attr.DataType := DbDataType.DateTime;
    Attr.TimeDependent := True;
    // Set attribute identifier and name
    Attr.Id := "RELEASE_DATE";
    Attr.Name := Release date and time;
    // Attribute can have empty values
    Attr.Nullable := True;
    // Save changes
    MObj.Save;
End Sub UserProc;

After executing the example an additional attribute with the DateTime type, that considers time component, is created in the MDM dictionary.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dict: IRdsDictionary;
    Attrs: IRdsAttributes;
    Attr: IRdsAttribute;
Begin
    MB := Params.Metabase;
    // Get MDM dictionary
    MObj := MB.ItemByIdNamespace["DICT", MB.ItemById["MDM"].Key].Edit();
    Dict := MObj As IRdsDictionary;
    // Get dictionary attributes
    Attrs := Dict.Attributes;
    // Add new attribute
    Attr := Attrs.Add();
    // Set attribute data type: date and time
    Attr.DataType := DbDataType.ddtDateTime;
    Attr.TimeDependent := True;
    // Set attribute identifier and name
    Attr.Id := "RELEASE_DATE";
    Attr.Name := Release date and time;
    // Attribute can have empty values
    Attr.Nullable := True;
    // Save changes
    MObj.Save();
End Sub;

See also:

IRdsAttribute