Edit: IRdsDictionaryElementDependents;
Edit: Prognoz.Platform.Interop.Rds.IRdsDictionaryElementDependents;
The Edit method opens the collection of dependencies on the element for edit.
Use the IRdsDictionaryElementDependents.Save method to save changes in the collection of dependencies.
Executing the example requires an MDM repository with the RDS identifier. The MDM dictionary with the Country identifier is created in this repository. Tracking links to elements is enabled for a dictionary.
Sub UserProc;
Var
MB: IMetabase;
Dict: IRdsDictionary;
Elements: IRdsDictionaryElements;
Depends: IRdsDictionaryElementDependents;
MBDepend: IMbElementDependencies;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemByIdNamespace("Country", MB.GetObjectKeyById("RDS")).Bind As IRdsDictionary;
Elements := (Dict.Open(Null) As IRdsDictionaryInstance).Elements;
Depends := Elements.Dependents(Elements.Element(1));
If Not Depends.IsEmpty Then
Depends.Edit;
MBDepend := Depends.Objects As IMbElementDependencies;
MBDepend.Clear;
Depends.Save;
End If;
End Sub UserProc;
On executing the example, availability of dependencies on the specified element of the MDM dictionary is checked. If dependencies exist, they are removed.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Dict: IRdsDictionary;
Elements: IRdsDictionaryElements;
Depends: IRdsDictionaryElementDependents;
MBDepend: IMbElementDependencies;
Begin
MB := Params.Metabase;
Dict := MB.ItemByIdNamespace["Country", MB.GetObjectKeyById("RDS")].Bind() As IRdsDictionary;
Elements := (Dict.Open(Null) As IRdsDictionaryInstance).Elements;
Depends := Elements.Dependents[Elements.Element[1]];
If Not Depends.IsEmpty Then
Depends.Edit();
MBDepend := Depends.Objects As IMbElementDependencies;
MBDepend.Clear();
Depends.Save();
End If;
End Sub;
See also: