Shortcut: IMetabaseObjectDescriptor;
The Shortcut property determines description of the object to which the shortcut refers.
If the object is not a shortcut, this property returns Null.
NOTE. If the object is a shortcut for the object from another repository, this property returns Null. To check, it is required to use the IMetabaseObjectDescriptor.IsLink property. The object to which the shortcut refer will be available after opening of the shortcut in the IMetabaseObjectInstance.Object property.
Executing the example requires a shortcut with the SHORTCUT_TO_OBJ_1 identifier that refers to any repository object. The repository also contains an object with the OBJ2 identifier.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MDesc: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
MDesc := MB.ItemById("SHORTCUT_TO_OBJ_1");
MDesc := MDesc.EditDescriptor;
MDesc.Shortcut := MB.ItemById("OBJ2");
MDesc.Name := "Shortcut for OBJ2";
MDesc.Id := "SHORTCUT_TO_OBJ2";
MDesc.SaveDescriptor;
End Sub UserProc;
After executing the example the name, the identifier and the object to which the SHORTCUT_TO_OBJ_1 shortcut refers are changed.
See also: