CreateSubMenuItem
Description
Creates a new SubMenu for already created Menu.
Syntax
// shellFrame points here into the IShellFrame interface
const result = await shellFrame.Commands.CreateSubMenuItem(
parentMenuItemId,
customCommand,
orderPriority,
);
Parameters
| Name | Optionality | Type | Description |
|---|---|---|---|
| parentMenuItemId | Required | number | ID of the Parent MenuItem. |
| customCommand | Required | number | Command to execute when the MenuItem is selected. |
| orderPriority | Required | number | Priority to assign to the new item. |
Return type
| Type | Description |
|---|---|
Promise < number > | ID of the newly created MenuItem. |
Exceptions
ArgumentError - parentMenuItemId, customCommand, or orderPriority is null or undefined, or when a builtin command is used as parent that doesn't support submenus.
NotFoundError - When the parent menu item or command is not found or access is denied.
DuplicateCommandError - When the command already exists in the menu.
InvalidOperationError - When the command location ID is null or undefined.