DefaultValue: Variant;
DefaultValue: object;
The DefaultValue property determines default value for the field.
Executing the example requires that the repository contains a table with the TABLE_DEFAULT_VALUE identifier.
Add links to the Db and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Table: ITable;
Fields: ITableFields;
Field: ITableField;
DefVal: Variant;
Begin
MB := MetabaseClass.Active;
Table := MB.ItemById("TABLE_DEFAULT_VALUE").Bind As ITable;
Fields := Table.Fields;
Field := Fields.Item(0);
DefVal := Field.DefaultValue;
End Sub UserProc;
After executing the example the DefVal variable contains a default expression determined for the first field.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Db;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Table: ITable;
Fields: ITableFields;
Field: ITableField;
DefVal: Object;
Begin
MB := Params.Metabase;
Table := MB.ItemById["TABLE_DEFAULT_VALUE"].Bind() As ITable;
Fields := Table.Fields;
Field := Fields.Item[0];
DefVal := Field.DefaultValue;
End Sub;
See also: