IMbElementDependenciesDatabase.Delete

Fore Syntax

Delete(Where: IMbElementDependencyTemplate);

Fore.NET Syntax

Delete(Where: Prognoz.Platform.Interop.Metabase.MbElementDependencyTemplateClass);

Parameters

Where - template in accordance with which delete is performed.

Description

The Delete method deletes dependencies corresponding with a specified template.

Fore Example

Executing the example requires that the repository contains an MDM dictionary with Country identifier. Tracking links on elements from other repository objects is activated for a dictionary. The dictionary is stored in the MDM repository with the RDS identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Dictionary: IMetabaseObjectDescriptor;
    DepDB: IMbElementDependenciesDatabase;
    Template: IMbElementDependencyTemplate;
    Elements: IRdsDictionaryElements;
    b: Boolean;
Begin
    MB := MetabaseClass.Active;
    DepDB := MB.ElementDependenciesDatabase;
    Dictionary := MB.ItemByIdNamespace("Country", MB.ItemById("RDS").Key);
    Elements := (Dictionary.Open(NullAs IRdsDictionaryInstance).Elements;
    Template := New MbElementDependencyTemplateClass.CreateByElement(
        Dictionary.Key, Elements.Element(1));
    If DepDB.Exists(Template) Then
WinApplication.YesNoCancelBox(font color="#800000">"Dependencies exist. Delete dependencies from element?", b);         If b Then
            DepDB.Delete(Template)
        End If;
    End If;
End Sub UserProc;

On executing the example dependencies availability of repository objects from a specified element of a dictionary is checked. If dependencies exist, the dialog box of their delete confirmation opens. If the user presses the OK button, dependencies will be deleted.

See also:

IMbElementDependenciesDatabase