Context Menus

Context Menus

You can customize the context menu in your applications.

Here are the actions available across all SaveToDB products:

  • Execute queries from tables and views
  • Execute stored procedures
  • Execute SQL commands
  • Execute HTTP commands

The SaveToDB add-in also supports:

For more details, check out Handler Types.

To add menu items, create records with the ContextMenu event type in the xls.handlers table.

Example

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODETARGET_WORKSHEETMENU_ORDEREDIT_PARAMETERS
 s04usp_order_formContextMenus04Google SearchHTTPhttps://www.google.com/search?as_q={name}11
 s04usp_order_formContextMenus04MenuSeparator40MENUSEPARATOR40
 s04usp_order_formContextMenus04xl_actions_items_insert_itemPROCEDURE_Reload411
 s04usp_order_formContextMenus04xl_actions_items_delete_itemPROCEDURE_Reload471
 s04usp_order_formContextMenus04xl_actions_items_rename_itemPROCEDURE_Reload491

This example includes two sections of items separated by a menu separator.

Menu separators must have unique names, as the table uses a unique index that spans from TABLE_SCHEMA to HANDLER_NAME.

You can leverage translation features to define business names for menu items. See Translating Object Names.

Use integer values in the MENU_ORDER column to control the order of items.

Note the _Reload value in the TARGET_WORKSHEET column. This value allows you to refresh data after executing the handler. For more options, refer to Target Worksheet Values.

Also, take note of the value 1 in the EDIT_PARAMETERS column. This value triggers the dialog box for editing parameters.

Context Parameters

Context menu handlers can access values from the active row, active query parameters, and the following context parameters:

Parameter NameValue
@ColumnName or @column_nameThe active column name
@CellValue or @cell_valueThe active cell's text value
@CellNumberValue or @cell_number_valueThe active cell's numeric value
@CellDateTimeValue or @cell_datetime_valueThe active cell's datetime value
@DataLanguage or @data_languageA data language code selected in the Options dialog box
@TableName or @table_nameThe qualified name of the active query object, e.g., [s02].[usp_cashbook]
@WindowsUserName or @windows_user_nameThe Windows login of the current user

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.