Opens a dialog box for editing attribute parameters of MDM dictionary.
Command parameters are passed in the Data property. Executing the command requires to specify the following value in this property:
Value type | Description |
IRdsAttribute | The dictionary attribute that must be opened for edit. |
The command can be executed only for MDM dictionary attributes (composite or table MDM dictionaries). The Execute method execution results in the True value if the OK button was clicked in the dialog box, and the False value if the Cancel button was clicked in the dialog box.
Executing the example requires a form and a button named Button1 on the form. The repository contains a MDM repository with the NSI_1 identifier and this repository contains a Dict_1 dictionary. The attribute with the COUNTRY_ID identifier is a part of a dictionary structure.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Dictionary: IRdsDictionary;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
bOK: Boolean;
Begin
MB := MetabaseClass.Active;
Dictionary := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit As IRdsDictionary;
Target := WinApplication.Instance.GetPluginTarget("Rds");
Context := Target.CreateExecutionContext;
Context.Data := Dictionary.Attributes.FindById("COUNTRY_ID");
bOK := Target.Execute("EditDictionaryAttribute", Context);
If bOK Then
(Dictionary As IMetabaseObject).Save;
End If;
text := bOK.ToString;
End Sub Button1OnClick;
Edit dialog box of the selected MDM dictionary opens by clicking the button. All the changes are saved if any of parameters are changed in the dialog box or if the OK button is clicked.
See also: