IMetabaseObjectCreateInfo.Shortcut

Syntax

Shortcut: IMetabaseObjectDescriptor;

Shortcut: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor;

Description

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

Comments

The necessary condition for creating the shortcut is setting the IMetabaseObjectCreateInfo.IsShortcut property to True.

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
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.Id := 
"Shortcut_OBJTEST";
    CrInfo.Name := 
Shortcut for OBJTEST;
    CrInfo.Parent := MB.Root;
    CrInfo.Shortcut := MB.ItemById(
"OBJTEST");
    CrInfo.IsShortcut := 
True;
    MB.CreateObject(CrInfo);
End Sub UserProc;

Public Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := Params.Metabase;
    CrInfo := MB.CreateCreateInfo();
    CrInfo.Id := "Shortcut_OBJTEST";
    CrInfo.Name := Shortcut for OBJTEST;
    CrInfo.Parent := MB.Root;
    CrInfo.Shortcut := MB.ItemById["OBJTEST"];
    CrInfo.IsShortcut := True;
    MB.CreateObject(CrInfo);
End Sub;

After executing the example a shortcut for the OBJTEST object will be created in the root of the repository.

See also:

IMetabaseObjectCreateInfo