Link: IRdsLink;
The Link property returns parent object.
Executing the example requires the MDM repository with the NSI_1 identifier that contains the MDM dictionary with the Dict_1 identifier and a form with the Button1 button placed on it. Add links to the Metabase, Dal and Rds system assemblies. The example is a handler of the OnClick event for the button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict: IRdsDictionary;
Attrs: IRdsAttributes;
Link: IRdsLink;
Param: IRdsParam;
ParamsControl: IRdsParamsControl;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;
Dict := MObj As IRdsDictionary;
Attrs := Dict.Attributes;
Link := Dict.Links.FindByAttribute(Attrs.FindById("LINK_ATTRIBUTE"));
Param := Link.Reference.Dictionary.Params.Item(0);
ParamsControl := Link.ParamsControl;
text:=ParamsControl.Link.Name;
End Sub Button1OnClick;
After executing the example, clicking the button displays the parent object name in the form title.
See also: