HasDefaultElement: Boolean;
HasDefaultElement(): boolean;
The HasDefaultElement method determines whether there is a default element in MDM dictionary.
Available values:
False. A default element is not set in the dictionary.
True. A default element is set in the dictionary.
Executing the example requires that the repository contains a table MDM dictionary with the RDS_DICT_OBJ identifier and with specified default element.
Add links to the Metabase, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Obj: IMetabaseObject;
Dict: IRdsDictionary;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get table MDM dictionary
Obj := MB.ItemById("RDS_DICT_OBJ").Edit;
Dict := Obj As IRdsDictionary;
// Check if there is default element
Debug.WriteLine(Dict.HasDefaultElement.ToString);
// Delete setting default element
Dict.ResetDefaultElement;
// Save dictionary
Obj.Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Obj: IMetabaseObject;
Dict: IRdsDictionary;
Begin
// Get current repository
MB := Params.Metabase;
// Get table MDM dictionary
Obj := MB.ItemById["RDS_DICT_OBJ"].Edit();
Dict := Obj As IRdsDictionary;
// Check if there is default element
system.Diagnostics.Debug.WriteLine(Dict.HasDefaultElement().ToString());
// Delete setting default element
Dict.ResetDefaultElement();
// Save dictionary
Obj.Save();
End Sub;
After executing the example the console window displays information about default element specified in the dictionary, and element setting is deleted.
See also: