IRdsDictionaryInstance.ClearData

Syntax

ClearData([ForceClearReferences: Boolean = False]);

Parameters

ForceClearReferences. Optional parameter in Fore. It determines whether elements are to be force deleted if there are links to them in related dictionaries.

Description

The ClearData method clears all the elements from an MDM dictionary.

Comments

The method is executed taking into account the ForceClearReferences parameter. Available parameter values:

NOTE. The elements are deleted without taking into account the parameters of opening the dictionary. To open the dictionary with the parameters, use the IMetabaseObjectDescriptor.Open method.

Example

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

Add links to the Metabase, Rds system assemblies.

Sub UserClearDict;
Var
    MB: IMetabase;
    MDMObj: IMetabaseObjectDescriptor;
    Dict: IRdsDictionary;
    DictInst: IRdsDictionaryInstance;
Begin
    MB := MetabaseClass.Active;
    
// Get MDM repository
    MDMObj := MB.ItemById("MDM");
    
// Get MDM dictionary
    Dict := MB.ItemByIdNamespace("MDM_DICT", MDMObj.Key).Bind As IRdsDictionary;
    
// Open dictionary
    DictInst := Dict.Open(Null);
    
// Delete all elements
    DictInst.ClearData(True);
End Sub UserClearDict;

After executing the example all elements are deleted from the MDM_DICT dictionary.

See also:

IRdsDictionaryInstance