Add(Object: IMetabaseObjectDescriptor): IMetabaseCustomObjectReference;
Object. Repository object, on which the object should depend.
The Add method adds a dependency in the collection.
Executing the example requires that the repository contains a custom class object with the OBJ_CUSTOM identifier and an object with the OBJ_REF identifier.
Add a link to the Metabase system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
Object: IMetabaseObject;
CustomObject: IMetabaseCustomObject;
Writer: IMetabaseCustomObjectWriter;
References: IMetabaseCustomObjectReferences;
Begin
Mb := MetabaseClass.Active;
Object := Mb.ItemById("OBJ_CUSTOM").Edit;
CustomObject := Object As IMetabaseCustomObject;
Writer := CustomObject.CreateWriter;
References := Writer.References;
References.Add(Mb.ItemById("OBJ_REF"));
Writer.Save;
Object.Save;
End Sub Button1OnClick;
After executing the example the OBJ_REF object is added to the list of objects on which OBJ_CUSTOM depends.
See also: