IMetabaseObjectCopyInfo.NoSave

Syntax

NoSave: Boolean;

Description

The NoSave property determines whether copy of an object is saved after copying.

Comments

The property is set to False by default, in this case a copy is saved at once. If the property is set to True, a copy is not saved after copying. The copy opened for edit will be available in the IMetabaseObjectCopyInfo.Destination property. It is used if after copying it is necessary to execute any additional changes in a copy to avoid double saving.

Example

Executing the example requires that the repository contains a database with the DB_1 identifier.

Add links to the Db and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    CInfo: IMetabaseObjectCopyInfo;
    MObj: IMetabaseObject;
    BD: IDatabase;
Begin
    MB := MetabaseClass.Active;
    CInfo := MB.CreateCopyInfo;
    CInfo.Id := "DB_2";
    CInfo.Name := "Database 2";
    CInfo.Destination := MB.Root;
    CInfo.Source := MB.ItemById("DB_1");
    CInfo.NoSave := True;
    MB.CopyObject(CInfo);
    MObj := CInfo.Destination As IMetabaseObject;
    BD := MObj As IDatabase;
    BD.LogonData.ParamValue("SCHEME") := "TestShema_1";
    MObj.Save;
End Sub UserProc;

After executing the example the database is copied to the repository root. The name of the scheme, to which a connection is established, is changed in the obtained database copy before saving.

See also:

IMetabaseObjectCopyInfo