Creating a custom commandMeridian Enterprise 2013 Developer's Guide | BlueCielo ECM Solutions

A user interface extension project can implement custom commands in addition to event handlers and property pages. The commands will appear in the menu bar menus and context menus for the objects to which the extension is applied. The commands can also be grouped together on a sub-menu.

The following procedure includes steps for creating a command and a command group. Follow the steps as directed to create either or both.

To create a custom command with the UIExtensionComposer:

  1. Open an existing Visual Studio user interface extension project or create a new project as described in Creating a user interface extension.
  2. In Solution Explorer, open the UIExtensionComposer and open its properties.
  3. Click the ellipsis button Ellipsis button in the Commands property field in the Properties window. The Commands Collection Editor dialog lists the commands defined in the extension.
  4. Click the down arrow in the Add button and select Command to add the command to a parent menu (not a sub-menu). Select Command group to create a command group in which to add the command later in this procedure. A new command or command group is added to the Members list.
  5. If you created a command, set the Tag property to the name of the command as you want to refer to it in code and the Caption property to name of the command as you want it to appear to users. If you created a command group, set the Caption property to name of the parent menu item as you want it to appear to users. This property works the same as the Sub-menu name option of custom commands that are defined in Meridian Enterprise Configurator. Then click OK.
  6. If you created a command group, again click the ellipsis button Ellipsis button in the Commands property field in the Properties window. The Commands Collection Editor dialog lists the commands defined in the command group. Continue from step 4 to create a command or a separator. If you created a command, click the Events buttonin the UIExtensionComposer toolbar. The event names appear.
  7. Double-click the CommandExecute event in the BC Meridian General group.
  8. Visual Basic .NET creates an empty event handler method and adds it to your code, similar to the following example.

This procedure will handle the Execute event for all commands defined in the extension. If you have more than one command in the same project, then you can use Tag property to distinguish between the commands, similar to the following example.

You can also add a command programmatically:

  1. Define an event handler method whose signature matches the delegate signature for the CommandExecute event, similar to the following example.
  2. Open the UIExtensionComposer in the code editor, find the code of the method’s constructor, and add a new command to the Commands collection, similar to the following example.

The custom command can be shown in the Tools menu of Meridian Enteprise PowerUser. To do so, apply the extension to the Environment class either with Meridian Enteprise Configurator or programmatically in the ExtensionRegister event handler similar to the following example:

See Also

Other Resources