IValidationCrossDatabaseMappings.SetDefault

Fore Syntax

SetDefault;

Fore.NET Syntax

SetDefault();

Description

The SetDefault method sets dimension bindings by default.

Comments

By default time series database dimensions with the same identifiers are bound. If dimension identifier of master data source is not found in the initial data source, the binding is not created.

Fore Example

Executing the example requires that the repository contains a time series database with the TSDB identifier containing a validation rule of the Comparison between Databases type with the VALID_CROSSDATABASE identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    TSDBKey: Integer;
    ValidFilter: IValidationFilter;
    CrossDb: IValidationCrossDatabase;
    AttrMappings: IValidationCrossDatabaseMappings;
Begin
    mb := MetabaseClass.Active;
    TSDBKey := mb.GetObjectKeyById("TSDB");
    ValidFilter := mb.ItemByIdNamespace("VALID_CROSSDATABASE", TSDBKey).Edit As IValidationFilter;
    CrossDb := ValidFilter.Details As IValidationCrossDatabase;
    AttrMappings := CrossDb.Mappings;
    AttrMappings.SetDefault;
    (ValidFilter As IMetabaseObject).Save;
End Sub UserProc;

After executing the example dimension bindings are set by default in the VALID_CROSSDATABASE validation rule.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    TSDBKey: uinteger;
    ValidFilter: IValidationFilter;
    CrossDb: IValidationCrossDatabase;
    AttrMappings: IValidationCrossDatabaseMappings;
Begin
    mb := Params.Metabase;
    TSDBKey := mb.GetObjectKeyById("TSDB");
    ValidFilter := mb.ItemByIdNamespace["VALID_CROSSDATABASE", TSDBKey].Edit() As IValidationFilter;
    CrossDb := ValidFilter.Details As IValidationCrossDatabase;
    AttrMappings := CrossDb.Mappings;
    AttrMappings.SetDefault();
    (ValidFilter As IMetabaseObject).Save();
End Sub;

See also:

IValidationCrossDatabaseMappings