Share this page

# Add custom toolbar buttons

You can create a custom button that is added to the toolbar of a Web Client module or of the Manual Runner window, and control what the button does by adding script to the ActionCanExecute event.

To add a custom button to a toolbar:

1. From the Web Client banner, select Settings > Workflow.

2. Go to the Toolbar Button Editor tab. From the Module list, select the module where you want to add a button.

3. Click Add. The button is given a default name.

4. Click the edit icon to define the following properties of the button.

   Property | Description
   --- | ---
   Caption | Specify the button label.
   Hint | Provide the mouse-over tooltip for the button.
   Action Name | Enter the action name for the button, which indicates what action is to be performed when users click the button.
   Action Name in Workflow | Read only and is automatically filled based on the action name, in the format of UserDefinedActions.<action name>. If you want to call the action in the project scripts, call UserDefinedActions.<action name>.
   Image | Select an icon for the button.

5. Click Save to add the button.

6. Add script to the ActionCanExecute event to define what the button does when users click it.

   1. Go to the Script Editor tab.

   2. From the Workflow Scripts tree, select Project Scripts > Common script > ActionCanExecute.

   3. In the scripts pane, add JavaScript code to define what to be performed when a user initiates an action by the button's action name.

      For example, the following code opens a message box when the user clicks the Requirements_msg button on the tool bar of the Requirements module:

      Copy code

          function ActionCanExecute(actionName) {
             if (actionName === 'UserDefinedActions.Requirement_msg') {
                      MsgBox('This requirement cannot be deleted.');
                  return false;
              }
              return true;
           }

   4. Click Save.

Back to top

https://admhelp.microfocus.com Application Quality Management 8942
Tips to improve your search results... OpenText™ Application Quality Management Help Center OpenText™ Application Quality Management Help Center OpenText™ Application Quality Management Help 26.1 All View Local Help Center View Online Help Center Version: