EditTemporary: IMetabaseObject;
The EditTemporary method opens the object for temporary change of properties.
The object can not be used in this mode. The "Object is not in the state of editing" error is generated during the saving.
Executing the example requires a form, a button positioned on it with the Button1 identifier, the ModelBox component and the UiModel component with the UiModel1 identifier that is the data source for ModelBox. The repository contains a modeling container with the CONT_MODEL identifier and a model created in it with the MODEL identifier.
Add links to the Metabase, Ms system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
ContKey: Integer;
Model: IMsModel;
Begin
MB := MetabaseClass.Active;
ContKey := MB.ItemById("CONT_MODEL").Key;
Model := MB.ItemByIdNamespace("MODEL", ContKey).EditTemporary As IMsModel;
UiModel1.Active := False;
UiModel1.Model := Model;
UiModel1.Active := True;
End Sub Button1OnClick;
After executing the example the MODEL model is opened in the ModelBox component. Model parameters can be edited but they cannot be saved.
See also: