IsShortcut: Boolean;
IsShortcut: boolean;
The IsShortcut property determines whether the shortcut is created for the present repository object.
If the property is set to True, in the IMetabaseObjectCreateInfo.Shortcut property it is necessary to determine the repository object for which the shortcut is created.
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.Permanent := True;
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.Permanent := True;
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: