IMetabaseObjectCreateInfo.Shortcut

Syntax

Shortcut: IMetabaseObjectDescriptor;

Description

The Shortcut property determines the repository object for which the shortcut should be created.

Comments

To create a shortcut, set the IMetabaseObjectCreateInfo.IsShortcut property to True.

To automatically save the shortcut in the repository, set the IMetabaseObjectCreateInfo.Permanent property to True.

To set shortcut location, use the IMetabaseObjectCreateInfo.Parent property.

Example

Executing the example requires that the repository contains an object with the OBJTEST identifier.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Create object description
    CrInfo := MB.CreateCreateInfo;
    // Set object identifier
    CrInfo.Id := "SHORTCUT_OBJTEST";
    // Set object name
    CrInfo.Name := "Shortcut for OBJTEST";
    // Set object location
    CrInfo.Parent := MB.Root;
    // Specify that created object is shortcut
    CrInfo.IsShortcut := True;
    // Specify that created object is not internal
    CrInfo.IsInternal := False;
    // Specify identifier of the object, for which shortcut will be created
    CrInfo.Shortcut := MB.ItemById("OBJTEST");
    // Save shortcut description
    CrInfo.Permanent := True;
    // Create an object in repository
    MB.CreateObject(CrInfo);
End Sub UserProc

After executing the example a shortcut with the SHORTCUT_OBJTEST identifier and the Shortcut for OBJTEST name will be created in the root of the repository.

See also:

IMetabaseObjectCreateInfo